SlideShare a Scribd company logo
You and Your StylesheetVirginia DeBoltBlogHer 09
30 Minute GoalsTalk about what CSS can doTalk about what a style rule looks likeTalk about how to identify the style that matches the part of your page you want to styleAnswer your specific questions
What CSS can DoSet color and background color for any elementSet font and font size for any elementSet margins, borders and padding around any elementCreate layouts Create list appearanceCreate link appearanceAnd more!
A CSS rule tells the browser how to render the HTMLdiv#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 stylediv#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 stylingdiv#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 lookdiv#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 rulebody.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 specificdiv.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 problemsQuestions?
ResourcesCSS 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

PPT
Html5 accessibility
PPT
HTML Fundamentals
PPT
Html5: What is it?
PDF
Creating HTML Pages
PPTX
Html5 structure tags
PDF
Class 1 handout (2) html exercises
PPT
Intro to html
PPT
WordPress Development Confoo 2010
Html5 accessibility
HTML Fundamentals
Html5: What is it?
Creating HTML Pages
Html5 structure tags
Class 1 handout (2) html exercises
Intro to html
WordPress Development Confoo 2010

What's hot (16)

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

Viewers also liked (6)

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

Similar to You and Your Stylesheet (20)

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

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Tartificialntelligence_presentation.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
A Presentation on Artificial Intelligence
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A comparative study of natural language inference in Swahili using monolingua...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Tartificialntelligence_presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Heart disease approach using modified random forest and particle swarm optimi...
cloud_computing_Infrastucture_as_cloud_p
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectroscopy.pptx food analysis technology
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
A Presentation on Artificial Intelligence
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction

You and Your Stylesheet

  • 1. You and Your StylesheetVirginia DeBoltBlogHer 09
  • 2. 30 Minute GoalsTalk about what CSS can doTalk about what a style rule looks likeTalk about how to identify the style that matches the part of your page you want to styleAnswer your specific questions
  • 3. What CSS can DoSet color and background color for any elementSet font and font size for any elementSet margins, borders and padding around any elementCreate layouts Create list appearanceCreate link appearanceAnd more!
  • 4. A CSS rule tells the browser how to render the HTMLdiv#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 stylediv#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 stylingdiv#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 lookdiv#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 rulebody.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 specificdiv.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 problemsQuestions?
  • 16. ResourcesCSS 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

  • #5: This is a rule targeting the content div on a blog page.
  • #7: This is a rule targeting the content div on a blog page.
  • #8: This is a rule targeting the content div on a blog page.
  • #9: This is a rule targeting the content div on a blog page.
  • #10: 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.
  • #11: With Web Developer Toolbar
  • #12: Using View Source you can figure out approximately the same information to see which selector may be the one you want to target.