- Understand the purpose and structure of CSS.
- Learn how to select and style HTML elements using CSS.
- Gain hands-on experience with various CSS properties and values.
- Introduction to CSS
- Understanding CSS Structure
- Four Steps to Writing CSS
- Common CSS Properties & Values
- CSS, or Cascading Style Sheets, gives websites style.
- Using CSS, you can change properties like color, spacing, fonts, positioning, animations, and more.
- HTML provides the structure, while CSS styles the appearance.
- Selector: The HTML element you want to style.
- Property: The aspect of the element you want to change (e.g., color, width).
- Value: The specific change you want to apply to the property.
- Example:
h1 {
color: blue;
}
- Choose an HTML element - this is your selector.
- Add opening and closing curly braces.
- Inside the braces, choose a property and give it a value, separated by a colon.
- End with a semicolon.
- Properties: There are hundreds, including
color
,background-color
,width
,text-align
,font-size
. - Values: They differ depending on the property.
- Examples:
color: red;
width: 400px;
font-size: 20px;
By the end of this lesson, you'll have hands-on experience with the fundamental concepts of CSS, enabling you to enhance the styling of web pages.
Happy coding!