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
 
جيفيرا باي الساحل الشمالي
جيفيرا باي الساحل الشماليجيفيرا باي الساحل الشمالي
جيفيرا باي الساحل الشماليReda Hassan
 
Deepak Soni BCA First Year
Deepak Soni BCA First YearDeepak Soni BCA First Year
Deepak Soni BCA First Yeardezyneecole
 
HTML5 Boilerplate - PV219
HTML5 Boilerplate - PV219HTML5 Boilerplate - PV219
HTML5 Boilerplate - PV219GrezCZ
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書拓樹 谷
 
Optimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesOptimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesSugree Phatanapherom
 
モダンな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 – enterjsGeilDanke
 
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 fiddleErin M. Kidwell
 
LessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG MeetingLessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG MeetingMyles Braithwaite
 
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>Mark Wubben
 
Teddy Bear Blue
Teddy Bear BlueTeddy Bear Blue
Teddy Bear Blueangeliclv
 
Building Secure Twitter Apps
Building Secure Twitter AppsBuilding Secure Twitter Apps
Building Secure Twitter AppsDamon Cortesi
 
Try Web Components
Try Web ComponentsTry Web Components
Try Web Components拓樹 谷
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Todd Zaki Warfel
 

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 AustinLisa Adkins
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptraghavanp4
 
Html structure
Html structureHtml structure
Html structureakkias
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet ApplicationsSubramanyan Murali
 
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 TricksCompare 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.pdfaroraenterprisesmbd
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applicationsjeff tapper
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3Felipe Lavín
 
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 1Biswadip Goswami
 
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 IE7goodfriday
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - BasicsEvan Hughes
 
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 SVGPatrick Chanezon
 
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, ClickStartScott DeLoach
 

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

Keeping Colors from Killing Your Product
Keeping Colors from Killing Your ProductKeeping Colors from Killing Your Product
Keeping Colors from Killing Your ProductChristopher Schmitt
 
[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 DesignChristopher 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 DesignChristopher Schmitt
 
[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 2014Christopher 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 DesignChristopher 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 CodeChristopher 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 DesignChristopher 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 DesignChristopher 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 DesignChristopher 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 DesignChristopher 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 DesignChristopher 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 DesignChristopher 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 DesignChristopher 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 DesignChristopher 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 CodeChristopher 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 DesignChristopher 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 DesignChristopher 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 DesignChristopher Schmitt
 
[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGsChristopher 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

Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 

Recently uploaded (20)

Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.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/