primary, secondary button styles
This time, we will define styles commonly applied to buttons.
primary button style
.btn-primary { background: var(--primary-color); color: #000000; }
-
background: var(--primary-color);: Sets the background color of the element. We use a variable named--primary-color. The--primary-colorvariable has already been assigned a value of#ffcd42earlier. Therefore,background: var(--primary-color);means the same asbackground: #ffcd42;. By using variables, it becomes easier to understand why a particular color was chosen when viewed later. -
color: #000000;: Sets the text color.#000000represents black.#000000uses the#RRGGBBformat to express colors, whereRR,GG, andBBrepresent red, green, and blue, respectively. The lower the values, the darker the color, and the higher the values, the brighter the color. For instance,#FF0000denotes red,#00FF00denotes green, and#000000signifies black since all values for red, green, and blue are 0.
secondary button style
.btn-secondary { margin: 5px 0; background-color: var(--bg-secondary); color: var(--bg-primary); }
-
margin: 5px 0;: Sets a margin of 5px on the top and bottom, and 0 on the left and right. -
background-color: var(--bg-secondary);: Sets the background color of the element. The--bg-secondaryvariable is used here, which has already been assigned the value#ffd35c. -
color: var(--bg-primary);: Sets the text color. The--bg-primaryvariable is used here, which has already been assigned the value#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