SlideShare a Scribd company logo
1 of 113
A More Perfect
Union with CSS


Christopher Schmitt
http://twitter.com/teleject
Christopher Schmitt
http://twitter.com/teleject
how do we go about
                   ?
solving our problems
we solve problems by
realizing the limitations
#1
Our Experience
Limits Our Designs
It’s Always a
    Plumbing
     Problem
#2
Our Browsers
Limit Our Design
part 2: applications
HTML+CSS
             Example #1




http://www.flickr.com/photos/o2ma/186648711/
<p>...</p>
<p>...</p>

<blockquote>
 <p>Ma quande lingues coalesce, li
grammatica del resultant
lingue es plu simplic e regulari quam
ti.</p>
</blockquote>

<p>...</p>
<p>...</p>
blockquote {
 background-image: url(bracket_left.gif);
 background-repeat: no-repeat;
 padding: 10px 0 0 27px;
 width: 175px;
 margin: 0 0.7em 0 0;
 float: left;
 font-family: Georgia, Times, quot;Times New Romanquot;,
serif;
 font-size: 1.2em;
 font-style: italic;
 color: black;
}
blockquote p {
 background-image: url(bracket_right.gif);
 background-repeat: no-repeat;
 background-position: bottom right;
 margin: 0;
 padding: 0 22px 10px 0;
 width:150px;
 text-align: justify;
 line-height: 1.3em;
}
<blockquote>
 bracket_left.gif

    <p>




                    bracket_right.gif
HTML+CSS
Example #2
Semantic
Markup
91
http://www.w3.org/TR/html4/index/elements.html
<h1><a href=quot;http://
www.usa.gov/quot;>United States of America</
a></h1>

 <ol><!-- Listing of States -->
  <li><a href=quot;http://www.alabama.gov/quot;>
<strong>State of Alabama</strong><i></i>
</a></li>

 <li><a href=quot;http://www.ct.gov/quot;>
<em><strong>State of Connecticut</
strong></em><i></i>
</a></li>

...

 </ol>
Some Common
       HTML Errors
• <p>&nbsp;</p>
• <p> ... <br><br><br> ... <br><br><br>...
• <h2>Subject Matter<br></h2>
• <p><h2>Subject Matter</h2></p>
• <p><img ></p>
Setting Up
the Easel
3D View of Box Model
“CSS Reset”

• http://developer.yahoo.com/yui/reset/
• http://meyerweb.com/eric/thoughts/
  2007/04/12/reset-styles/
  • http://meyerweb.com/eric/tools/css/reset/
    index.html
<div id=quot;easelquot;>

 <h1><a href=quot;http://
www.usa.gov/quot;>United States of America</
a></h1>

 <ol><!-- Listing of States -->
  <li><a href=quot;http://www.alabama.gov/quot;>
<strong>State of Alabama</strong>
</a></li>

...

</ol>

</div><!-- /easel -->
body {
  margin: 10px 0 0 0;
  padding: 0;
  text-align: center;
}
#easel {
  width: 955px;
  margin: 0 auto;
  text-align: left;
  position: relative;
}
Clearing Out
the Content
#easel ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

#easel strong {
  display: none;
}
Striping
Normal Flow

• While normal flow is the default method of
  rendering a page, the placement of the
  elements can be altered
 • Floats
 • CSS position property
  • Values: absolute, relative, fixed or static
Absolute Positioning

• When an element is absolutely positioned, it
  is taken out of normal flow and positioned
  relative to the edges of its containing box,
  according to its offset properties.
• Absolutely positioned elements are ignored
  by other elements within normal flow.
Relative Positioning
•   When an element is relatively positioned, it is
    initially placed within normal flow, and then
    adjusted according to its offset properties.

•   #positioned {
     position: relative;
     top: 50px;
     right: 30px;
     background-color: #eee;
    }
Relative Positioning
•   The browser lays out the paragraphs according
    to normal flow, then offsets the positioned
    paragraph 50 pixels from the top, and 30 pixels
    from the right of its default position.

•   And like absolute positioning, relatively
    positioned elements can overlap other
    elements.

•   Note that if you don’t specify any offset
    properties for a relatively positioned element, it
    is placed according to normal flow.
#easel {
    width: 955px;
    margin: 0 auto;
    text-align: left;
    position: relative;
  }
#easel em {
    width: 955px;
    height: 50px;
    display: block;
    background: #BF0A30;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
  }
13
Attribute Selectors
•   a[title] { /* rules */ }
    a[href] { /* rules */ }

•   p[id] { /* rules */ }
    p[class] { /* rules */ }

•   img[alt] { /* rules */ }
    img[src] { /* rules */ }

•   blockquote[cite] { /* rules */ }
a[href=quot;http://delaware.gov/quot;] em {
  background: white;
  top: 50px;
  left: 0;
}
a[href=quot;http://www.georgia.gov/quot;] em {
  top: 100px;
  left: 0;
}
...
Pooling the Stars
h1 a {
  position: absolute;
  width: 440px;
  height: 350px;
  background: #002868;
  text-indent: -9999em;
  margin: 0;
  padding: 0;
  z-index: 20;
}
Getting Rid of Text
• sIFR (Scalable Inman Flash Replacement):
  http://wiki.novemberborn.net/sifr3
• Image Replacement Rundown:
  http://mezzoblue.com/tests/revised-image-
  replacement/
Stars
Block Level - <h2>




Inline - <strong>
a[href=quot;http://www.alabama.gov/quot;] i {
  background-image: url(stars.gif);
  display: block;
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 50;
  width: 24px;
  height: 23px;
}
Texture
Alpha Transparency (PNGs)

http://christopherschmitt.com/2007/10/30/png-transparency-
             for-internet-explorer-ie6-and-beyond/
Alpha Transparency (PNGs)
Adding PNGs
• First, download the .htc script at TwinHelix
  Designs.
  • http://www.twinhelix.com/css/iepngfix/
Adding PNGs
• First, download the .htc script at TwinHelix
  Designs.
  • http://www.twinhelix.com/css/iepngfix/
• After downloading the script, upload the
  script to your Web server.
Adding PNGs
• Then, create a blank gif file.
 • This image file is 1×1 pixel with the color
    set as transparent. Within the .htc script,
    change the line that references the
    blank.gif file so that it points to your gif’s
    location on the server.
Adding PNGs
• Create a separate CSS file (we’ll name it
  ie.css), and include within in the following
  single line, referencing the location of
  the .htc file:
• img {
   behavior: url(iepngfix.htc);
  }
Adding PNGs
• But, we only want to load this CSS file when
  the page is viewed in IE6-.
• Use conditional comments:
  <!--[if lte IE 6]>
  <link rel=quot;stylesheetquot; type=quot;text/cssquot;
  media=quot;screenquot; href=quot;ie.cssquot; />
  <![endif]-->
#easel em {
  width: 955px;
  height: 50px;
  display: block;
  background: #BF0A30;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  background-image: url(flag_bkgd.png);
  background-position: 50%;
  background-attachment: fixed;
}
#easel h1 a {
  position: absolute;
  width: 440px;
  height: 350px;
  background: #002868;
  text-indent: -9999em;
  margin: 0;
  padding: 0;
  z-index: 20;
  background-image: url(flag_bkgd.png);
  background-position: 50%;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
a[href=quot;http://delaware.gov/quot;] em {
 background: white;
  top: 50px;
  left: 0;
  background-image: url(flag_bkgd.png);
  background-position: 50%;
  background-attachment: fixed;
}
Stretching
Setting Fonts with Ems

• “Default size in all browsers is 16 pixels”
• Multiply default size by 62.5%, you get 10px
 • http://clagnut.com/blog/348/
 • http://www.alistapart.com/articles/
    howtosizetextincss/
body {
  font-size: 62.5%;
  margin: 10px 0 0 0;
  padding: 0;
 text-align: center;
}
Design
                Fixed   Flexible
  Element

 Flag Width     955px   95.5em

Stripe Height   50px     5em

  Star Top      13px    1.3em

  Star Left     90px     9em
Design
               Fixed   Flexible
  Element

Union Height   440px    44em


Union Width    350px    35em
Design




               X
               Fixed   Flexible
  Element

Union Height   440px    44em


Union Width    350px    35em
#easel h1 a {
  position: absolute;
  width: 21.5em;
  height: 17.5em;
  background: #002868;
  text-indent: -9999em;
  margin: 0;
  padding: 0;
  z-index: 20;
  background-image: url(flag_bkgd3.png);
  background-position: 50%;
  background-attachment: fixed;
}
OMG! Stars
i:after {
  content: quot;Mquot;;
  color: white;
  font-size: 2em;
}
i:after {
  content: quot;48quot;; // unicode
  font-family: quot;Zapf Dingbatsquot;;
  color: white;
  font-size: 2.5em;
  font-style: normal;
}
#1
Our Experience
Limits Our Designs
        #2
 Our Browsers
 Limit Our Design
The CSS Summit
• Eight CSS experts:
 • Molly Holzschlag, Stephanie Sullivan,
    Kimberly Blessing, Dave McFarland, more
• Virtual conference
 • CSS + Web fonts, IE6, jQuery, Flexible
    Layouts, etc.
• July 18th, 9-5pm ET
• http://CSSSummit.com/
THANK YOU!


Christopher Schmitt
schmitt@heatvision.com
http://twitter.com/teleject
ChristopherSchmitt.com

More Related Content

What's hot

Css 2c (2) (1) (1) (2)
Css 2c (2) (1) (1) (2)Css 2c (2) (1) (1) (2)
Css 2c (2) (1) (1) (2)
gng542
 
HTML5 Boilerplate - PV219
HTML5 Boilerplate - PV219HTML5 Boilerplate - PV219
HTML5 Boilerplate - PV219
GrezCZ
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
拓樹 谷
 
Optimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesOptimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile Devices
Sugree Phatanapherom
 
Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddle
Erin M. Kidwell
 

What's hot (20)

Css 2c (2) (1) (1) (2)
Css 2c (2) (1) (1) (2)Css 2c (2) (1) (1) (2)
Css 2c (2) (1) (1) (2)
 
جيفيرا باي الساحل الشمالي
جيفيرا باي الساحل الشماليجيفيرا باي الساحل الشمالي
جيفيرا باي الساحل الشمالي
 
Critical Rendering Path
Critical Rendering PathCritical Rendering Path
Critical Rendering Path
 
Deepak Soni BCA First Year
Deepak Soni BCA First YearDeepak Soni BCA First Year
Deepak Soni BCA First Year
 
HTML5 Boilerplate - PV219
HTML5 Boilerplate - PV219HTML5 Boilerplate - PV219
HTML5 Boilerplate - PV219
 
Exp of mmt
Exp of mmtExp of mmt
Exp of mmt
 
Bhanu pratap
Bhanu pratapBhanu pratap
Bhanu pratap
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
Optimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesOptimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile Devices
 
モダンなCSS設計パターンを考える
モダンなCSS設計パターンを考えるモダンなCSS設計パターンを考える
モダンなCSS設計パターンを考える
 
2016 First steps with Angular 2 – enterjs
2016 First steps with Angular 2 – enterjs2016 First steps with Angular 2 – enterjs
2016 First steps with Angular 2 – enterjs
 
Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddle
 
HTML5 & CSS3 Flag
HTML5 & CSS3 FlagHTML5 & CSS3 Flag
HTML5 & CSS3 Flag
 
LessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG MeetingLessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG Meeting
 
Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>
 
Teddy Bear Blue
Teddy Bear BlueTeddy Bear Blue
Teddy Bear Blue
 
Building Secure Twitter Apps
Building Secure Twitter AppsBuilding Secure Twitter Apps
Building Secure Twitter Apps
 
Try Web Components
Try Web ComponentsTry Web Components
Try Web Components
 
Jogos
JogosJogos
Jogos
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3
 

Similar to A More Perfect Union with CSS

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
 
Html structure
Html structureHtml structure
Html structure
akkias
 
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
 
Css code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdfCss code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdf
aroraenterprisesmbd
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
Felipe Lavín
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - Basics
Evan Hughes
 

Similar to A More Perfect Union with CSS (20)

What I brought back from Austin
What I brought back from AustinWhat I brought back from Austin
What I brought back from Austin
 
Theme 23
Theme 23Theme 23
Theme 23
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Html structure
Html structureHtml structure
Html structure
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet Applications
 
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
 
Css code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdfCss code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdf
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applications
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
 
Your First ASP_Net project part 1
Your First ASP_Net project part 1Your First ASP_Net project part 1
Your First ASP_Net project part 1
 
The Future of CSS
The Future of CSSThe Future of CSS
The Future of CSS
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Gmail tutorials
Gmail tutorialsGmail tutorials
Gmail tutorials
 
Making Your Site Look Great in IE7
Making Your Site Look Great in IE7Making Your Site Look Great in IE7
Making Your Site Look Great in IE7
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - Basics
 
Eg2 M1 2009 I
Eg2 M1 2009 IEg2 M1 2009 I
Eg2 M1 2009 I
 
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVGJavaOne 2009 -  2d Vector Graphics in the browser with Canvas and SVG
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
 
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
 

More from Christopher Schmitt

[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code
Christopher Schmitt
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt
 
[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
GitHub for People Who Don't Code
GitHub for People Who Don't CodeGitHub for People Who Don't Code
GitHub for People Who Don't Code
Christopher Schmitt
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs
Christopher Schmitt
 

More from Christopher Schmitt (20)

Keeping Colors from Killing Your Product
Keeping Colors from Killing Your ProductKeeping Colors from Killing Your Product
Keeping Colors from Killing Your Product
 
[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web Design[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web Design
 
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
 
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
 
[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
 
[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
 
[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
 
GitHub for People Who Don't Code
GitHub for People Who Don't CodeGitHub for People Who Don't Code
GitHub for People Who Don't Code
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
 
[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design
 
[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs
 
[amigos] HTML5 and CSS3
[amigos] HTML5 and CSS3[amigos] HTML5 and CSS3
[amigos] HTML5 and CSS3
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

A More Perfect Union with CSS

  • 1. A More Perfect Union with CSS Christopher Schmitt http://twitter.com/teleject
  • 3. how do we go about ? solving our problems
  • 4. we solve problems by realizing the limitations
  • 6.
  • 7. It’s Always a Plumbing Problem
  • 8.
  • 9.
  • 10.
  • 11.
  • 13.
  • 14.
  • 15.
  • 16.
  • 18. HTML+CSS Example #1 http://www.flickr.com/photos/o2ma/186648711/
  • 19.
  • 20. <p>...</p> <p>...</p> <blockquote> <p>Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti.</p> </blockquote> <p>...</p> <p>...</p>
  • 21.
  • 22. blockquote { background-image: url(bracket_left.gif); background-repeat: no-repeat; padding: 10px 0 0 27px; width: 175px; margin: 0 0.7em 0 0; float: left; font-family: Georgia, Times, quot;Times New Romanquot;, serif; font-size: 1.2em; font-style: italic; color: black; }
  • 23. blockquote p { background-image: url(bracket_right.gif); background-repeat: no-repeat; background-position: bottom right; margin: 0; padding: 0 22px 10px 0; width:150px; text-align: justify; line-height: 1.3em; }
  • 24. <blockquote> bracket_left.gif <p> bracket_right.gif
  • 25.
  • 26.
  • 28.
  • 29.
  • 32.
  • 33.
  • 34. <h1><a href=quot;http:// www.usa.gov/quot;>United States of America</ a></h1> <ol><!-- Listing of States --> <li><a href=quot;http://www.alabama.gov/quot;> <strong>State of Alabama</strong><i></i> </a></li> <li><a href=quot;http://www.ct.gov/quot;> <em><strong>State of Connecticut</ strong></em><i></i> </a></li> ... </ol>
  • 35.
  • 36. Some Common HTML Errors • <p>&nbsp;</p> • <p> ... <br><br><br> ... <br><br><br>... • <h2>Subject Matter<br></h2> • <p><h2>Subject Matter</h2></p> • <p><img ></p>
  • 38. 3D View of Box Model
  • 39. “CSS Reset” • http://developer.yahoo.com/yui/reset/ • http://meyerweb.com/eric/thoughts/ 2007/04/12/reset-styles/ • http://meyerweb.com/eric/tools/css/reset/ index.html
  • 40.
  • 41.
  • 42. <div id=quot;easelquot;> <h1><a href=quot;http:// www.usa.gov/quot;>United States of America</ a></h1> <ol><!-- Listing of States --> <li><a href=quot;http://www.alabama.gov/quot;> <strong>State of Alabama</strong> </a></li> ... </ol> </div><!-- /easel -->
  • 43. body { margin: 10px 0 0 0; padding: 0; text-align: center; } #easel { width: 955px; margin: 0 auto; text-align: left; position: relative; }
  • 44.
  • 46. #easel ol { list-style: none; margin: 0; padding: 0; } #easel strong { display: none; }
  • 47.
  • 49. Normal Flow • While normal flow is the default method of rendering a page, the placement of the elements can be altered • Floats • CSS position property • Values: absolute, relative, fixed or static
  • 50. Absolute Positioning • When an element is absolutely positioned, it is taken out of normal flow and positioned relative to the edges of its containing box, according to its offset properties. • Absolutely positioned elements are ignored by other elements within normal flow.
  • 51.
  • 52. Relative Positioning • When an element is relatively positioned, it is initially placed within normal flow, and then adjusted according to its offset properties. • #positioned { position: relative; top: 50px; right: 30px; background-color: #eee; }
  • 53.
  • 54. Relative Positioning • The browser lays out the paragraphs according to normal flow, then offsets the positioned paragraph 50 pixels from the top, and 30 pixels from the right of its default position. • And like absolute positioning, relatively positioned elements can overlap other elements. • Note that if you don’t specify any offset properties for a relatively positioned element, it is placed according to normal flow.
  • 55. #easel { width: 955px; margin: 0 auto; text-align: left; position: relative; } #easel em { width: 955px; height: 50px; display: block; background: #BF0A30; position: absolute; top: 0; left: 0; z-index: 1; }
  • 56.
  • 57. 13
  • 58. Attribute Selectors • a[title] { /* rules */ } a[href] { /* rules */ } • p[id] { /* rules */ } p[class] { /* rules */ } • img[alt] { /* rules */ } img[src] { /* rules */ } • blockquote[cite] { /* rules */ }
  • 59. a[href=quot;http://delaware.gov/quot;] em { background: white; top: 50px; left: 0; } a[href=quot;http://www.georgia.gov/quot;] em { top: 100px; left: 0; } ...
  • 60.
  • 62.
  • 63.
  • 64. h1 a { position: absolute; width: 440px; height: 350px; background: #002868; text-indent: -9999em; margin: 0; padding: 0; z-index: 20; }
  • 65. Getting Rid of Text • sIFR (Scalable Inman Flash Replacement): http://wiki.novemberborn.net/sifr3 • Image Replacement Rundown: http://mezzoblue.com/tests/revised-image- replacement/
  • 66.
  • 67. Stars
  • 68. Block Level - <h2> Inline - <strong>
  • 69. a[href=quot;http://www.alabama.gov/quot;] i { background-image: url(stars.gif); display: block; position: absolute; top: 13px; left: 13px; z-index: 50; width: 24px; height: 23px; }
  • 70.
  • 71.
  • 75. Adding PNGs • First, download the .htc script at TwinHelix Designs. • http://www.twinhelix.com/css/iepngfix/
  • 76. Adding PNGs • First, download the .htc script at TwinHelix Designs. • http://www.twinhelix.com/css/iepngfix/ • After downloading the script, upload the script to your Web server.
  • 77. Adding PNGs • Then, create a blank gif file. • This image file is 1×1 pixel with the color set as transparent. Within the .htc script, change the line that references the blank.gif file so that it points to your gif’s location on the server.
  • 78. Adding PNGs • Create a separate CSS file (we’ll name it ie.css), and include within in the following single line, referencing the location of the .htc file: • img { behavior: url(iepngfix.htc); }
  • 79. Adding PNGs • But, we only want to load this CSS file when the page is viewed in IE6-. • Use conditional comments: <!--[if lte IE 6]> <link rel=quot;stylesheetquot; type=quot;text/cssquot; media=quot;screenquot; href=quot;ie.cssquot; /> <![endif]-->
  • 80. #easel em { width: 955px; height: 50px; display: block; background: #BF0A30; position: absolute; top: 0; left: 0; z-index: 1; background-image: url(flag_bkgd.png); background-position: 50%; background-attachment: fixed; }
  • 81.
  • 82. #easel h1 a { position: absolute; width: 440px; height: 350px; background: #002868; text-indent: -9999em; margin: 0; padding: 0; z-index: 20; background-image: url(flag_bkgd.png); background-position: 50%; background-repeat: no-repeat; background-attachment: fixed; }
  • 83.
  • 84. a[href=quot;http://delaware.gov/quot;] em { background: white; top: 50px; left: 0; background-image: url(flag_bkgd.png); background-position: 50%; background-attachment: fixed; }
  • 85.
  • 86.
  • 87.
  • 88.
  • 90.
  • 91.
  • 92.
  • 93. Setting Fonts with Ems • “Default size in all browsers is 16 pixels” • Multiply default size by 62.5%, you get 10px • http://clagnut.com/blog/348/ • http://www.alistapart.com/articles/ howtosizetextincss/
  • 94. body { font-size: 62.5%; margin: 10px 0 0 0; padding: 0; text-align: center; }
  • 95. Design Fixed Flexible Element Flag Width 955px 95.5em Stripe Height 50px 5em Star Top 13px 1.3em Star Left 90px 9em
  • 96. Design Fixed Flexible Element Union Height 440px 44em Union Width 350px 35em
  • 97.
  • 98. Design X Fixed Flexible Element Union Height 440px 44em Union Width 350px 35em
  • 99. #easel h1 a { position: absolute; width: 21.5em; height: 17.5em; background: #002868; text-indent: -9999em; margin: 0; padding: 0; z-index: 20; background-image: url(flag_bkgd3.png); background-position: 50%; background-attachment: fixed; }
  • 100.
  • 101.
  • 102.
  • 104. i:after { content: quot;Mquot;; color: white; font-size: 2em; }
  • 105.
  • 106.
  • 107. i:after { content: quot;48quot;; // unicode font-family: quot;Zapf Dingbatsquot;; color: white; font-size: 2.5em; font-style: normal; }
  • 108.
  • 109.
  • 110.
  • 111. #1 Our Experience Limits Our Designs #2 Our Browsers Limit Our Design
  • 112. The CSS Summit • Eight CSS experts: • Molly Holzschlag, Stephanie Sullivan, Kimberly Blessing, Dave McFarland, more • Virtual conference • CSS + Web fonts, IE6, jQuery, Flexible Layouts, etc. • July 18th, 9-5pm ET • http://CSSSummit.com/