Professional Documents
Culture Documents
CSS: Separating Design and Content: Kevin Campbell
CSS: Separating Design and Content: Kevin Campbell
Assumptions
You know HTML You do not know CSS You care about aesthetics and function You have 50 minutes to kill
What Well Do
What is CSS? View some code and talk basics Why use CSS?
Implementations Resources
Created by Hakon Wium Lie of MIT in 1994 Has become the W3C standard for controlling visual presentation of web pages Separates design elements from structural logic You get control and maintain the integrity of your data
Selectors
Selectors
Class Selectors
<H1 CLASS=warning>Danger!</H1> <P CLASS=warning>Be careful</P> . In your HTML code H1.warning {color: red;} OR to an entire class .warning {color:red;}
<H1 STYLE=color: blue; font-size: 20pt;>A large purple <HTML><HEAD><TITLE>Stylin!</TITLE> <HEAD> Heading</H1> <STYLE TYPE=text/css> <LINK REL=stylesheet TYPE=text/css H1 {color: purple;} HREF=styles/mystyles.css> For individual elementscolor: gray;} P {font-size: 10pt; using the STYLE attribute </HEAD> </STYLE> </HEAD> separation of style and content. This is true Keeping all your styles in an external document is </HTML> simpler
Why CSS?
Advantages of CSS
Workflow
Faster downloads Streamlined site maintenance Global control of design attributes Precise control (Advanced)
Positioning Fluid layouts
Cost Savings
Web usability redesign can increase the sales/conversion rate by 100% (source: Jakob Nielson) CSS requires less code Tables require spacer images Entire table has to render before content CSS can control the order that elements download (content before images)
Increased Reach
CSS website is compatible w/ many different devices In 2008 an est. 58 Million PDAs will be sold (Source: eTForecast.com) 1/3 of the worlds population will own a wireless device by 2010
Implementations
See http://www.csszengarden.com
CSS support in browsers is still uneven Make sure your CSS properties are supported
Resources
http://www.csszengarden.com
http://www.w3.org/Style/CSS/
http://css.maxdesign.com.au/
http://webmonkey.wired.com/web monkey/reference/stylesheet_guide