70 likes | 168 Views
The Basics of Using Cascading Style Sheets (CSS). by John Sklar Based on what Elizabeth Castro Taught me. A Basic Style has two parts. Selector – the element you wish to format. Declaration – what you want it to do. Property – the CSS property you want to set.
E N D
The Basics of Using Cascading Style Sheets (CSS) by John Sklar Based on what Elizabeth Castro Taught me.
A Basic Style has two parts • Selector – the element you wish to format. • Declaration – what you want it to do. • Property – the CSS property you want to set. • Value – What you want the property to be…
The Declaration has 2 Parts • CSS Property – A list of what CSS can actually do • Value – What you want the formatting to look like
So How Does It Work • Pick a selector • Set the properties • Put the whole thing in the <HEAD> • And then use the selector tag in your document. • You can specify a lot of different attributes but you will need a list.
Google CSS Properties • Web Design Group: http://www.htmlhelp.com/reference/css/properties.html • Index D O T Css http://www.htmlhelp.com/reference/css/properties.html • WWW.W3.org http://www.w3.org/TR/REC-CSS2/propidx.html *http://www.w3schools.com/css/css_reference.asp *My personal favorite
Apply Your Styles To A Site • If you have a lot of styles and you want to use them in several web pages, you can remove the styles from the page and save them in an ASCII or text file with a CSS extension. • This file should have not formatting but I suggest that you comment the file fully. • Use /* to start the comment and */ to end it.
Link The CSS File • If your style sheet is called mystyles.css use code like this: <html> <head> <title>Style Demo - Linked</title> <link rel="stylesheet" type = "text/css" href="mystyles.css" /> </head> • If your style sheet is called mystyles.css use code like this: <html> <head> <title>Style Demo - Linked</title> <link rel="stylesheet" type = "text/css" href="mystyles.css" /> </head>