Primary and Secondary Button Styles
Let's define styles that are commonly applied to buttons.
Primary Button Style
.btn-primary { background: var(--primary-color); color: #000000; }
-
background: var(--primary-color);: This sets the background color of the element. We have used a variable named--primary-color. The--primary-colorvariable has already been set to the value#ffcd42. Thus,background: var(--primary-color);is equivalent tobackground: #ffcd42;. By using variables, the reasoning behind color choices remains clear when revisited later. -
color: #000000;: This sets the text color.#000000represents black. It is expressed in the format#RRGGBB, whereRR,GG,BBstand for red, green, and blue, respectively. Lower values result in darker colors, while higher values result in brighter colors. For example,#FF0000represents red,#00FF00represents green, and#000000is black since red, green, and blue are all set to 0.
Secondary Button Style
.btn-secondary { margin: 5px 0; background-color: var(--bg-secondary); color: var(--bg-primary); }
-
margin: 5px 0;: This sets the top and bottom margins to 5px and the left and right margins to 0. -
background-color: var(--bg-secondary);: This sets the background color of the element using the value from the--bg-secondaryvariable, which is already defined as#ffd35c. -
color: var(--bg-primary);: This sets the text color using the value from the--bg-primaryvariable, which is already defined as#ffffff.
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