SlideShare a Scribd company logo
1 of 16
You and Your Stylesheet Virginia DeBolt BlogHer 09
30 Minute Goals Talk about what CSS can do Talk about what a style rule looks like Talk about how to identify the style that matches the part of your page you want to style Answer your specific questions
What CSS can Do Set color and background color for any element Set font and font size for any element Set margins, borders and padding around any element Create layouts  Create list appearance Create link appearance And more!
A CSS rule tells the browser how to render the HTML div#content { 	font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; 	font-size: 1em; 	line-height: 1.4; 	background:#fff; 	color:#000; 	margin:0 1em; 	padding:0 1em 0 0; }
The Selector selects the element to style div#content { 	font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; 	font-size: 1em; 	line-height: 1.4; 	background:#fff; 	color:#000; 	margin:0 1em; 	padding:0 1em 0 0; }
The declaration is inside {} div#content { font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; 	font-size: 1em; 	line-height: 1.4; 	background:#fff; 	color:#000; 	margin:0 1em; 	padding:0 1em 0 0; }
The property is a property of the element you are styling div#content{ font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; 	font-size: 1em; 	line-height: 1.4; 	background:#fff; 	color:#000; 	margin:0 1em; 	padding:0 1em 0 0; }
The value sets how you want each property of the selector to look div#content{ font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; font-size: 1em; 	line-height: 1.4; 	background:#fff; 	color:#000; 	margin:0 1em; 	padding:0 1em 0 0; }
How can you figure out which selector to change? Out of all the notes on the piano which one do you press?  Out of all the selectors and rules in the stylesheet, which one do you change?
Figuring out the Selectors with Web Developer Toolbar in Firefox
Figuring out the selectors with View Source <div id="container"> <div id="content" class="hfeed”> <div id="post-2819" class="hentryp1 post publish author-vdebolt category-blogher category-news-politics category-socialmedia category-twitter y2009 m06 d30 h04"> 				<h2 class="entry-title"><a href="http://www.webteacher.ws/2009/06/30/spreading-the-news/" title="Permalink to Spreading the News" rel="bookmark">Spreading the News</a></h2> 				<div class="entry-date"><abbr class="published" title="2009-06-30T07:18:37-0400">Tuesday, June 30, 2009</abbr></div> 				<div class="entry-content"> <p>Remember how remarkable it seemed several months ago when a plane sat down in the Hudson River and the first news and photos of the crash came from Twitter? Then the fly ash spill in TVA’s Kingston plant was covered first on Twitter. That was about the time that articles about how the old media just didn’t get digital media started appearing.</p>
Sometimes several selectors have the same rule body.single h2.entry-title, body.page h2.entry-title, body.search h2.entry-title { 	margin:1em 0 -0.5em; } A comma separated list of selectors—all follow the same rule.
Sometimes selectors get really specific div.entry-content cite, div.comments ol.commentlist cite { 	border-bottom:1px dotted #999; 	cursor:help; } Selects any cite element  that is a descendant of an ol element with a class attribute that contains the word commentlist  that is a descendant of a div element with a class attribute that contains the word comments.
When you are trying to change something, you may need to get really specific too. ol {} not specific enough? Try div.entry-content ol {} instead. .small {} not specific enough? Try div#content p.small
Let’s talk about your problems Questions?
Resources CSS cascade - a simple step-by-step presentation: http://www.maxdesign.com.au/2009/06/30/css-cascade/ Web Teacher Tips: http://www.webteacher.ws/web-teacher-tips-and-tutorials/ CSS: The Definitive Guide by Eric A. Meyer, O’Reilly, 2007

More Related Content

What's hot

1.3 creating links
1.3 creating links1.3 creating links
1.3 creating links
Bulldogs83
 
Xhtml Part1
Xhtml Part1Xhtml Part1
Xhtml Part1
nleesite
 

What's hot (16)

1.3 creating links
1.3 creating links1.3 creating links
1.3 creating links
 
Html tags
Html tagsHtml tags
Html tags
 
Technical SEO "Overoptimization"
Technical SEO "Overoptimization"Technical SEO "Overoptimization"
Technical SEO "Overoptimization"
 
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
 
Solving Complex JavaScript Issues and Leveraging Semantic HTML5
Solving Complex JavaScript Issues and Leveraging Semantic HTML5Solving Complex JavaScript Issues and Leveraging Semantic HTML5
Solving Complex JavaScript Issues and Leveraging Semantic HTML5
 
What's New on the Facebook Platform, May 2011
What's New on the Facebook Platform, May 2011What's New on the Facebook Platform, May 2011
What's New on the Facebook Platform, May 2011
 
The 5 minute guide to RDFa...in only 6 minutes 40 seconds
The 5 minute guide to RDFa...in only 6 minutes 40 secondsThe 5 minute guide to RDFa...in only 6 minutes 40 seconds
The 5 minute guide to RDFa...in only 6 minutes 40 seconds
 
HTML5 with examples
HTML5 with examplesHTML5 with examples
HTML5 with examples
 
merb.intro
merb.intromerb.intro
merb.intro
 
Vanilla Forums Theme Guide
Vanilla Forums Theme GuideVanilla Forums Theme Guide
Vanilla Forums Theme Guide
 
Customizing the Appearance and HTML Output of Visualforce Pages
Customizing the Appearance and HTML Output of VisualforcePages Customizing the Appearance and HTML Output of VisualforcePages
Customizing the Appearance and HTML Output of Visualforce Pages
 
iGoogle Gadgets @ Your Library
iGoogle Gadgets @ Your LibraryiGoogle Gadgets @ Your Library
iGoogle Gadgets @ Your Library
 
Xhtml Part1
Xhtml Part1Xhtml Part1
Xhtml Part1
 
Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)
 
Fundamentals Of Html
Fundamentals Of HtmlFundamentals Of Html
Fundamentals Of Html
 
Where to focus your SEO efforts to have the most impact Digital Summit Atlant...
Where to focus your SEO efforts to have the most impact Digital Summit Atlant...Where to focus your SEO efforts to have the most impact Digital Summit Atlant...
Where to focus your SEO efforts to have the most impact Digital Summit Atlant...
 

Viewers also liked

Viewers also liked (6)

Twitter For Writers
Twitter For WritersTwitter For Writers
Twitter For Writers
 
Southwest Conference on Disability 2011
Southwest Conference on Disability 2011Southwest Conference on Disability 2011
Southwest Conference on Disability 2011
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar to You and Your Stylesheet

introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
vikram singh
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Content
maycourse
 
What I brought back from Austin
What I brought back from AustinWhat I brought back from Austin
What I brought back from Austin
Lisa Adkins
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML Tricks
Compare Infobase Limited
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
sanjay2211
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - Basics
Evan Hughes
 

Similar to You and Your Stylesheet (20)

Html Expression Web
Html Expression WebHtml Expression Web
Html Expression Web
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStart
 
The Frameless Opac
The Frameless OpacThe Frameless Opac
The Frameless Opac
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop Notes
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 Presentation
 
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02
 
Class 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsClass 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & Ids
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Content
 
What I brought back from Austin
What I brought back from AustinWhat I brought back from Austin
What I brought back from Austin
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML Tricks
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
 
Web 2.0 & Search Engines
Web 2.0 & Search EnginesWeb 2.0 & Search Engines
Web 2.0 & Search Engines
 
DG Group - Active Or Passive Website
DG Group - Active Or Passive WebsiteDG Group - Active Or Passive Website
DG Group - Active Or Passive Website
 
Microformats at Web 2.0 Expo April 2007
Microformats at Web 2.0 Expo April 2007Microformats at Web 2.0 Expo April 2007
Microformats at Web 2.0 Expo April 2007
 
CSS For Online Journalism
CSS For Online JournalismCSS For Online Journalism
CSS For Online Journalism
 
CSS
CSSCSS
CSS
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Introducing YUI
Introducing YUIIntroducing YUI
Introducing YUI
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - Basics
 

Recently uploaded

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Recently uploaded (20)

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 

You and Your Stylesheet

  • 1. You and Your Stylesheet Virginia DeBolt BlogHer 09
  • 2. 30 Minute Goals Talk about what CSS can do Talk about what a style rule looks like Talk about how to identify the style that matches the part of your page you want to style Answer your specific questions
  • 3. What CSS can Do Set color and background color for any element Set font and font size for any element Set margins, borders and padding around any element Create layouts Create list appearance Create link appearance And more!
  • 4. A CSS rule tells the browser how to render the HTML div#content { font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; font-size: 1em; line-height: 1.4; background:#fff; color:#000; margin:0 1em; padding:0 1em 0 0; }
  • 5. The Selector selects the element to style div#content { font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; font-size: 1em; line-height: 1.4; background:#fff; color:#000; margin:0 1em; padding:0 1em 0 0; }
  • 6. The declaration is inside {} div#content { font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; font-size: 1em; line-height: 1.4; background:#fff; color:#000; margin:0 1em; padding:0 1em 0 0; }
  • 7. The property is a property of the element you are styling div#content{ font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; font-size: 1em; line-height: 1.4; background:#fff; color:#000; margin:0 1em; padding:0 1em 0 0; }
  • 8. The value sets how you want each property of the selector to look div#content{ font-family: Frutiger, Univers, "Helvetica Neue", arial, helvetica, sans-serif; font-size: 1em; line-height: 1.4; background:#fff; color:#000; margin:0 1em; padding:0 1em 0 0; }
  • 9. How can you figure out which selector to change? Out of all the notes on the piano which one do you press? Out of all the selectors and rules in the stylesheet, which one do you change?
  • 10. Figuring out the Selectors with Web Developer Toolbar in Firefox
  • 11. Figuring out the selectors with View Source <div id="container"> <div id="content" class="hfeed”> <div id="post-2819" class="hentryp1 post publish author-vdebolt category-blogher category-news-politics category-socialmedia category-twitter y2009 m06 d30 h04"> <h2 class="entry-title"><a href="http://www.webteacher.ws/2009/06/30/spreading-the-news/" title="Permalink to Spreading the News" rel="bookmark">Spreading the News</a></h2> <div class="entry-date"><abbr class="published" title="2009-06-30T07:18:37-0400">Tuesday, June 30, 2009</abbr></div> <div class="entry-content"> <p>Remember how remarkable it seemed several months ago when a plane sat down in the Hudson River and the first news and photos of the crash came from Twitter? Then the fly ash spill in TVA’s Kingston plant was covered first on Twitter. That was about the time that articles about how the old media just didn’t get digital media started appearing.</p>
  • 12. Sometimes several selectors have the same rule body.single h2.entry-title, body.page h2.entry-title, body.search h2.entry-title { margin:1em 0 -0.5em; } A comma separated list of selectors—all follow the same rule.
  • 13. Sometimes selectors get really specific div.entry-content cite, div.comments ol.commentlist cite { border-bottom:1px dotted #999; cursor:help; } Selects any cite element that is a descendant of an ol element with a class attribute that contains the word commentlist that is a descendant of a div element with a class attribute that contains the word comments.
  • 14. When you are trying to change something, you may need to get really specific too. ol {} not specific enough? Try div.entry-content ol {} instead. .small {} not specific enough? Try div#content p.small
  • 15. Let’s talk about your problems Questions?
  • 16. Resources CSS cascade - a simple step-by-step presentation: http://www.maxdesign.com.au/2009/06/30/css-cascade/ Web Teacher Tips: http://www.webteacher.ws/web-teacher-tips-and-tutorials/ CSS: The Definitive Guide by Eric A. Meyer, O’Reilly, 2007

Editor's Notes

  1. This is a rule targeting the content div on a blog page.
  2. This is a rule targeting the content div on a blog page.
  3. This is a rule targeting the content div on a blog page.
  4. This is a rule targeting the content div on a blog page.
  5. There are several ways to figure out what selector you need to look for in the stylesheet. One uses the Web Developer Toolbar in Firefox. Other browsers have similar tools to help web developers. Or you can just search through View Source and figure it out.
  6. With Web Developer Toolbar
  7. Using View Source you can figure out approximately the same information to see which selector may be the one you want to target.