Download presentation
Presentation is loading. Please wait.
1
CSS Styles Introduction
2
CSS (Cascading style Sheets)
We use CSS to add style to our website. This could be color, font size, positioning, hover effects…
3
Making a Stylesheet Create a new file called “styles.css” Put this file in the same directory with your html files
4
Linking to your Stylesheet
Now you need to put a link to your stylesheet in each of your html files so that the styles are applied to them. Relationship is stylesheet File Name
5
Now let’s add flare to our site
Adding Styles Now let’s add flare to our site
6
Placement All of the css code will be written in the styles.css file Also note that you will need to start out with a blank stylesheet so if there’s anything in it, delete it
7
Format h1 { } First you put the tag you wish to style
You follow this by {}. All the styles go inside the {} h1 { }
8
Adding Styles for a selector
Each style is in the format: property: value; So we have: h2 { color: green; font-size: 16px; }
9
Adding a Color h1 { color:red; }
Now all h1 tags in our document will have the color red. h1 { color:red; }
10
Multiple Styles h1 { color: red; font-size: 24px; }
Let’s add a second style to change the font size of the h1. And now the h1 is a little smaller. h1 { color: red; font-size: 24px; }
11
Adding another Selector
Now all paragraphs will be colored green Note: We can add as many selectors as we like! h1 { color:red; font-size:24px; } p { color:green;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.