Common Button Styles
In this lesson, we will define a common .btn class to be applied to buttons.
.btn { display: inline-block; padding: 12px 32px; border-radius: 30px; text-transform: uppercase; font-size: 14px; transition: 0.3s; }
-
display: inline-block;: This places the element inline with others, while still allowing block-level element properties (like width and height) to be applied. -
padding: 12px 32px;: Sets the element's vertical padding to 12px and horizontal padding to 32px. -
border-radius: 30px;: Rounds the corners of the element to a radius of 30px. -
text-transform: uppercase;: Converts the text content to uppercase. For example, 'hello' becomes 'HELLO'. -
font-size: 14px;: Sets the size of the font to 14px. -
transition: 0.3s;: Ensures that any changes to the element's properties occur over 0.3 seconds, creating smooth transitions for transformations like size, color, or position changes.
Lessons in this chapter · Creating Navigation
- 1. What is a Container?
- 2. What is Navigation?
- 3. Styling the Navigation Bar
- 4. Styling Navigation div
- 5. Create a Logo
- 6. Difference Between span and p Tags
- 7. Creating a Menu
- 8. Configuring Menu Items
- 9. Styling the Menu
- 10. Creating a Button
- 11. Styling Buttons
- 12. Common Button Style
- 13. primary, secondary button styles
- 14. How to Style Buttons and Add Icons in Menus
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help