SlideShare ist ein Scribd-Unternehmen logo
1 von 98
Downloaden Sie, um offline zu lesen
Doing it in style
CREATING BEAUTIFUL SITES, THE WEB STANDARDS WAY
Patrick H. Lauke / WebDD / 3 February 2007
Part one: web standards
Visual aesthetics?
“Beautiful sites” can be created with any technology...
●
Table-based layouts
●
Font tags
●
Giant images
●
etc
Why bother with web standards/CSS?
Web standard tenets
Boil down to three things:
●
Separation of content and presentation
●
Valid (published grammar)
●
Semantic markup/code
Web standards elements
Building a page by defining:
●
What it is
●
What it looks like
Web standards and aesthetics?
“You can't make good looking sites with web
standards...”
Traditional “old school” way
Choice of markup purely down to their look
●
<h1> is too big ... I'll use <h4> instead
●
<blockquote> to indent
●
More space between paragraphs ... add a few
<p></p>
Traditional “old school” way
...then sprinkle presentational markup on top
●
forget <h4> ... <p><font size="+3"
color="ffffff><b>...</b></font></p>
● <p>this is <b>important</b>.</p>
Web standards process
Distinct tasks:
●
Mark up content in most appropriate elements -
convey meaning, not look
●
Apply styling (override browser defaults)
Model, View, Controller (MVC) parallels?
Why web standards
Some advantages:
●
Lighter code
●
Easier to maintain
●
Easier to change look/feel
●
Multiple output media
●
Accessibility
●
SEO
Part two: common pitfalls
New technology, old habits
<p><font size="+3" color="ffffff">...</font></p>
<p><span style="font-size: 200%; color:
#ffffff">...</span></p>
<p style="font-size: 200%; color:
#ffffff">...</p>
Meaningless content
Presentational:
<p class="headingbig">Heading</p>
<p>This is <span
class="bold">important</span>.</p>
<p class="headingsmall">Subheading</p>
Semantic:
<h1>Heading</h1>
<p>This is <strong>important</strong>.</p>
<h2>Subheading</h2>
Non-semantic class/id names
<p>I know <a href="..." class="red">CSS</a>.</p>
.red { color: red; }
I know CSS.
Non-semantic class/id names?
<p>I know <a href="..." class="red">CSS</a>.</p>
.red { color: green; }
I know CSS.
Semantic class/id names!
Presentational:
<p class="boldred">Error: no entry found</p>
Semantic:
<p class="warning">Error: no entry found</p>
Semantic digression...
Conveys meaning? Don't forget to mark it up
accordingly...
<p class="warning"><strong>Error: no entry
found</strong></p>
Classitis – the “labelmaker” approach
.nav { color: green; }
<ul>
<li><a href="..." class="nav"> ... </a></li>
<li><a href="..." class="nav"> ... </a></li>
<li><a href="..." class="nav"> ... </a></li>
<li><a href="..." class="nav"> ... </a></li>
<li><a href="..." class="nav"> ... </a></li>
</ul>
Classitis – cured
#nav a { color: green; }
<ul id="nav">
<li><a href="..."> ... </a></li>
<li><a href="..."> ... </a></li>
<li><a href="..."> ... </a></li>
<li><a href="..."> ... </a></li>
<li><a href="..."> ... </a></li>
</ul>
●
Be smart with your CSS
●
Use semantic structure to your advantage
Divitis – everything in neatly labelled boxes
<div id="header">
<h1>Patrick's rants</h1>
</div>
<div id="navigation">
<ul>...</ul>
</div>
<div id="footer">
<p>©2007 ... </p>
</div>
Divitis – cured
<h1 id="header">Patrick's rants</h1>
<ul id="navigation">...</ul>
<p id="footer">©2007 ... </p>
●
Knowledge about your content to simplify markup.
●
Not easy with generic template/CMS?
Part three: techniques
Tables?
“I've just learnt web standards and removed all tables
from my site...”
Tables (faked)
Misguided zealots go too far...
<div>
<div>
<span>First name</span>
<span>Last name</span>
</div>
<div>
<span>Patrick</span>
<span>Lauke</span>
</div>
...
</div>
Tables!
Not all tables are evil...
●
Tabular content (Excel spreadsheet)
●
Best way to define relationship
●
Accessibility
Explicit semantics of tables
<table>
<tr>
<td>Name</td>
<td>Phone</td>
<td>Email</td>
</tr>
<tr>
<td>Patrick H. Lauke</td>
<td>0161 2954779</td>
<td>p.h.lauke@salford.ac.uk</td>
</tr>
...
</table>
Explicit semantics of tables
<table>
<tr>
<th scope="col">Name</th>
<th scope="col">Phone</th>
<th scope="col">Email</th>
</tr>
<tr>
<th scope="row">Patrick H. Lauke</th>
<td>0161 2954779</td>
<td>p.h.lauke@salford.ac.uk</td>
</tr>
...
</table>
Explicit semantics of tables
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Phone</th>
<th scope="col">Email</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Patrick H. Lauke</td>
<td>0161 2954779</td>
<td>p.h.lauke@salford.ac.uk</td>
</tr>
...
</tbody>
Explicit semantics and styling
With thead/tbody easy to nicely style table
thead { background-color: #444; color: #fff; }
Explicit semantics and styling
Style th differently in table body
thead { background-color: #444; color: #fff; }
tbody th { font-weight: normal;
text-align: left;
}
Explicit semantics and styling
Underline each row
table { border-collapse: collapse; }
thead { background-color: #444; color: #fff; }
tbody th { font-weight: normal;
text-align: left;
}
tbody tr th,
tbody tr td { border-bottom: 1px #444 solid; }
Explicit semantics and styling
Headless table
table { border-collapse: collapse; }
thead { position: absolute; top: 0; left: -999em;
}
tbody th { font-weight: normal;
text-align: left;
}
tbody tr th,
tbody tr td { border-bottom: 1px #444 solid; }
...but IE doesn't like that...
Explicit semantics and styling
Headless table (even in IE)
table { border-collapse: collapse; }
thead,
thead tr { position: absolute; top: 0; left:
-999em; }
tbody th { font-weight: normal;
text-align: left;
}
tbody tr th,
tbody tr td { border-bottom: 1px #444 solid; }
“Fluff” images
Accessibility and ALT attributes:
●
Convey purpose/meaning of images
●
alt="" (null alt) if only decorative
“Fluff” images
<p class="warning">
<img src="warn.gif" ... alt="" />
<strong>Error: no entry found</strong>
</p>
p.warning { padding: 10px;
border: 1px #000 solid;
}
“Fluff” images via CSS
If only decorative...
●
Decorative = presentation
●
Add images as non-repeating CSS backgrounds
“Fluff” images
<p class="warning">
<strong>Error: no entry found</strong>
</p>
p.warning { padding: 10px;
border: 1px #000 solid;
background: url(warn.gif)
no-repeat left top;
}
“Fluff” images
<p class="warning">
<strong>Error: no entry found</strong>
</p>
p.warning { padding: 10px 10px 10px 50px;
border: 1px #000 solid;
background: url(warn.gif)
no-repeat 10px center;
}
“Fluff” images
<p class="warning">
<strong>Error: no entry found</strong>
</p>
p.warning { padding: 10px 10px 10px 50px;
border: 1px #000 solid;
background: url(warn.gif)
no-repeat 10px center;
min-height: 30px;
}
“Fluff” images
Also works for inline elements
<p>See our <a href=""><img src="qt.gif" alt=""
... /> quicktime video</a> for more
information.</p>
“Fluff” images
<p>See our <a href="" class="qt">quicktime
video</a> for more information.</p>
a.qt { background: url(qt.gif)
no-repeat left center;
padding-left: 50px;
}
Beware of line-height, min-height won't work
Softening up boxes
Same principle, but for different purpose (“rounded
boxes”)
<blockquote><p>...</p></blockquote>
blockquote { color: #fff;
background-color: #73aeb5;
}
Softening up boxes
Softening up boxes
Apply image flush to corner
<blockquote><p>...</p></blockquote>
blockquote { color: #fff;
background: #73aeb5 url(corner.gif)
no-repeat left top;
}
Softening up boxes
More padding
<blockquote><p>...</p></blockquote>
blockquote { color: #fff;
background: #73aeb5 url(corner.gif)
no-repeat left top;
padding: 20px;
}
Softening up boxes
Changing box colour
<blockquote><p>...</p></blockquote>
blockquote { color: #fff;
background: #f77921 url(corner.gif)
no-repeat left top;
padding: 20px;
}
Softening up boxes
Softening up boxes
Naïve approach
<blockquote><p>...</p></blockquote>
blockquote { padding: 10px 20px 40px 20px;
width: 210px;
color: #333;
background: url(bigquote.gif)
no-repeat left top;
}
Softening up boxes
Softening up boxes
“Sliding doors”
<blockquote><p>...</p></blockquote>
blockquote { padding: 10px 20px 40px 20px;
width: 210px;
color: #333;
background: url(quote-top.gif)
no-repeat left top;
}
blockquote p { background: url(quote-bottom.gif)
no-repeat left bottom;
}
Softening up boxes
<blockquote><p>...</p></blockquote>
blockquote { padding: 20px 0 0 0;
width: 210px;
color: #333;
background: url(quote-top.gif)
no-repeat left top;
}
blockquote p { padding: 0 20px 80px 20px;
background: url(quote-bottom.gif)
no-repeat left bottom;
}
Image replacement
Images used for headings etc
●
Branding
●
“Fancy” font
●
Graphical buttons
<h1><img src="heading.gif" alt="..." /></h1>
Image replacement
Potential issues?
●
Accessibility (zoom)
●
Multiple devices
●
Images off
Image replacement
●
Mark up text version (proper semantics)
●
Hide this text
●
Put an image in its place
Image replacement
Wrap text in a span, apply background image
<h1><span>Heading</span></h1>
h1 { width: 350px; height: 75px;
padding: 0;
background: url(heading.gif)
no-repeat left top;
}
Image replacement
Hide the span
<h1><span>Heading</span></h1>
h1 { width: 350px; height: 75px;
padding: 0;
background: url(heading.gif)
no-repeat left top;
}
h1 span { display: block; position: absolute;
top: 0; left: -999em;
}
Image replacement
Taking it further: more than just a heading
<div id="header">
<h1>Heading</h1>
<h2>Subheading</h2> ...
</div>
#header * { display: block; position: absolute;
top: 0; left: -999em;
}
#header { ... }
Image replacement (eXtreme)
Too far? Whole page replaced...
<body>
<h1>Heading</h1>
<h2>Subheading</h2> ...
</body>
body * { ... }
body { ... }
Image replacement issues
From accessibility point of view:
●
Images off / CSS on
●
Text resizing / zoom
Multiple (unskilled/WYSIWYG) authors?
Backgrounds don't normally print
Image replacement trick?
Replacing an image with another image
<h1><img src="logo_bw.png" ... /></h1>
@media screen {
h1 { ...
background: url(logo_colour.jpg)
...
}
h1 img { ... /* off left */ ... }
}
Black/white logo for print, colour for on-screen
Forms
●
Traditionally laid out in tables
●
Semantic “grey area”
Forms
Accessibility considerations:
●
Form controls need associated label
●
Grouping related controls
●
Logical order
Forms – associating labels
Implicit:
<label>First name: <input type="text"
name="fname" /></label>
Explicit:
<label for="fname_id">First name:</label>
<input type="text" name="fname" id="fname_id" />
Forms – associating labels
“Belt & braces”
<label for="fname_id">First name:
<input type="text" name="fname" id="fname_id" />
</label>
Forms – “built-in” labels
<input type="submit" value="Send application" />
Forms – grouping related controls
<p>What's your favourite colour?</p>
<label for="col_r">
<input type="radio" name="col" id="col_r"
value="red" /> Red</label>
<label for="col_g">
<input type="radio" name="col" id="col_g"
value="green" /> Green</label>
Radio buttons, checkboxes, form sections
Forms – grouping related controls
<fieldset>
<legend>What's your favourite colour?</legend>
<label for="col_r">
<input type="radio" name="col" id="col_r"
value="red" /> Red</label>
<label for="col_g">
<input type="radio" name="col" id="col_g"
value="green" /> Green</label>
</fieldset>
Forms – grouping related controls
<fieldset>
<legend>Billing address</legend>
...
</fieldset>
<fieldset>
<legend>Shipping address</legend>
...
</fieldset>
Forms – basic styling
<form ...>
<label>...</label>
<input />
<label>...</label>
<input />
<label>...</label>
<select> ... </select>
<input type="submit" ... />
</form>
label, input, select { display: block; }
Forms – basic styling
<form ...>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<select> ... </select></div>
<input type="submit" ... />
</form>
Forms – basic styling
<form ...>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<select> ... </select></div>
<input type="submit" ... />
</form>
div input, div select { float: right; }
Forms – basic styling
<form ...>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<select> ... </select></div>
<input type="submit" ... />
</form>
div label { float: left; }
div input, div select { float: right; }
Forms – basic styling
<form ...>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<select> ... </select></div>
<input type="submit" ... />
</form>
div label { float: left; clear: both; }
div input, div select { float: right; }
Forms – basic styling
<form ...>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<select> ... </select></div>
<input type="submit" ... />
</form>
div { height: 1.3em; }
div label { float: left; clear: both; }
div input, div select { float: right; }
Forms – basic styling
<form ...>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<select> ... </select></div>
<input type="submit" ... />
</form>
div { height: 1.3em; }
div input,
div select { position: absolute;
top: 0; left: 7em;
}
Forms – basic styling
<form ...>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<input /></div>
<div><label>...</label>
<select> ... </select></div>
<input type="submit" ... />
</form>
div { height: 1.3em; position: relative; }
div input,
div select { position: absolute;
top: 0; left: 7em;
}
Forms – basic styling
<form ...>
...
<div><input type="checkbox" ... />
<label>...</label></div>
...
</form>
div { height: 1.3em; position: relative; }
div input,
div select { position: absolute;
top: 0; left: 7em;
}
Forms – basic styling
<form ...>
...
<div class="check"><input type="checkbox" ...
/>
<label>...</label></div>
...
</form>
div { height: 1.3em; position: relative; }
div input,
div select { position: absolute;
top: 0; left: 7em;
}
div.check input { position: relative; left: 0; }
Forms – basic styling
<form ...>
<label> ... <input /></label>
<label> ... <input /></label>
<label> ... <select> ... </select> </label>
<label class="check"><input /> ... </label>
<input type="submit" ... />
</form>
label { height: 1.3em; position: relative; }
label input,
label select { position: absolute;
top: 0; left: 7em;
}
label.check input { position: relative;
left: 0;
}
Forms – basic required fields
<form ...>
...
<label class="req"> ...<span>(required)</span>
<input /></label>
...
</form>
...
label.req span { position: absolute;
top: 0; left: -999em;
}
label.req { color: #f00; font-weight: bold; }
Layout
●
Most complex part of CSS
●
Look at a micro-layout for general technique
Layout
Look at a micro-layout for general technique:
<div class="example">
<img ... />
<p>Image caption</p>
...
Main body of text
...
</div>
div.example { background-color: #fff9b2;
padding: 20px;
}
Layout
div.example { background-color: #fff9b2;
padding: 20px 20px 20px 340px;
position: relative;
}
div.capimage p { font-size: 0.6em;
font-weight: bold;
}
div.capimage { position: absolute;
top: 20px; left: 20px;
}
Layout
div.example { background-color: #fff9b2;
padding: 20px 340px 20px 20px;
position: relative;
}
div.capimage p { font-size: 0.6em;
font-weight: bold;
}
div.capimage { position: absolute;
top: 20px; right: 20px;
}
Part four: epilogue
Hurdles to adoption
What's holding web standards and CSS back?
Hurdles to adoption
What's holding web standards and CSS back?
●
Requires technical mind with aesthetic sensibility
Hurdles to adoption
What's holding web standards and CSS back?
●
Designers don't understand the web
Hurdles to adoption
What's holding web standards and CSS back?
●
Developers don't understand the web
Hurdles to adoption
What's holding web standards and CSS back?
●
Old dogs and new tricks
Hurdles to adoption
What's holding web standards and CSS back?
●
Difficult to get robust, general techniques
Hurdles to adoption
What's holding web standards and CSS back?
●
Tools getting better, but still far off

Weitere ähnliche Inhalte

Was ist angesagt?

CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
拓樹 谷
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Content
maycourse
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibility
jsmith92
 

Was ist angesagt? (20)

Modular HTML & CSS Workshop
Modular HTML & CSS WorkshopModular HTML & CSS Workshop
Modular HTML & CSS Workshop
 
Modular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopModular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo Workshop
 
Semantic HTML5
Semantic HTML5Semantic HTML5
Semantic HTML5
 
モダンなCSS設計パターンを考える
モダンなCSS設計パターンを考えるモダンなCSS設計パターンを考える
モダンなCSS設計パターンを考える
 
WCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML SemanticsWCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML Semantics
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
HTML5 Semantics
HTML5 SemanticsHTML5 Semantics
HTML5 Semantics
 
More of less (take 2)
More of less (take 2)More of less (take 2)
More of less (take 2)
 
CSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML SemanticsCSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML Semantics
 
CSS Best practices
CSS Best practicesCSS Best practices
CSS Best practices
 
Webpages And Dynamic Content
Webpages And Dynamic ContentWebpages And Dynamic Content
Webpages And Dynamic Content
 
Progressive Prototyping w/HTML5, CSS3 and jQuery
Progressive Prototyping w/HTML5, CSS3 and jQueryProgressive Prototyping w/HTML5, CSS3 and jQuery
Progressive Prototyping w/HTML5, CSS3 and jQuery
 
Html5 ux london
Html5 ux londonHtml5 ux london
Html5 ux london
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
 
モダンなCSS設計パターンを考える
モダンなCSS設計パターンを考えるモダンなCSS設計パターンを考える
モダンなCSS設計パターンを考える
 
The Users are Restless
The Users are RestlessThe Users are Restless
The Users are Restless
 
Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web Standards
 
A More Perfect Union with CSS
A More Perfect Union with CSSA More Perfect Union with CSS
A More Perfect Union with CSS
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibility
 
Nanoformats
NanoformatsNanoformats
Nanoformats
 

Ähnlich wie Doing it in style - creating beautiful sites, the web standards way / WebDD / Reading / 3 February 2007

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Terry Ryan
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Senthil Kumar
 

Ähnlich wie Doing it in style - creating beautiful sites, the web standards way / WebDD / Reading / 3 February 2007 (20)

Web standards pragmatism - from validation to the real world / Web Developers...
Web standards pragmatism - from validation to the real world / Web Developers...Web standards pragmatism - from validation to the real world / Web Developers...
Web standards pragmatism - from validation to the real world / Web Developers...
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
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
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
LessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG MeetingLessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG Meeting
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
A Primer on HTML 5 - By Nick Armstrong
A Primer on HTML 5 - By Nick ArmstrongA Primer on HTML 5 - By Nick Armstrong
A Primer on HTML 5 - By Nick Armstrong
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
Slicing the web
Slicing the webSlicing the web
Slicing the web
 
TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
 
Presentation html5 css3 by thibaut
Presentation html5 css3 by thibautPresentation html5 css3 by thibaut
Presentation html5 css3 by thibaut
 
Html5 & CSS overview
Html5 & CSS overviewHtml5 & CSS overview
Html5 & CSS overview
 
Blog HTML example for IML 295
Blog HTML example for IML 295Blog HTML example for IML 295
Blog HTML example for IML 295
 
Using Core Themes in Drupal 8
Using Core Themes in Drupal 8Using Core Themes in Drupal 8
Using Core Themes in Drupal 8
 

Mehr von Patrick Lauke

Mehr von Patrick Lauke (20)

These (still) aren't the SCs you're looking for ... (mis)adventures in WCAG 2...
These (still) aren't the SCs you're looking for ... (mis)adventures in WCAG 2...These (still) aren't the SCs you're looking for ... (mis)adventures in WCAG 2...
These (still) aren't the SCs you're looking for ... (mis)adventures in WCAG 2...
 
Pointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Pointer Events Working Group update / TPAC 2023 / Patrick H. LaukePointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Pointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
 
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
 
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
 
Too much accessibility - good intentions, badly implemented / Public Sector F...
Too much accessibility - good intentions, badly implemented / Public Sector F...Too much accessibility - good intentions, badly implemented / Public Sector F...
Too much accessibility - good intentions, badly implemented / Public Sector F...
 
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
 
Evaluating web sites for accessibility with Firefox / Manchester Digital Acce...
Evaluating web sites for accessibility with Firefox / Manchester Digital Acce...Evaluating web sites for accessibility with Firefox / Manchester Digital Acce...
Evaluating web sites for accessibility with Firefox / Manchester Digital Acce...
 
Managing and educating content editors - experiences and ideas from the trenc...
Managing and educating content editors - experiences and ideas from the trenc...Managing and educating content editors - experiences and ideas from the trenc...
Managing and educating content editors - experiences and ideas from the trenc...
 
Implementing Web Standards across the institution: trials and tribulations of...
Implementing Web Standards across the institution: trials and tribulations of...Implementing Web Standards across the institution: trials and tribulations of...
Implementing Web Standards across the institution: trials and tribulations of...
 
Geolinking content - experiments in connecting virtual and physical places / ...
Geolinking content - experiments in connecting virtual and physical places / ...Geolinking content - experiments in connecting virtual and physical places / ...
Geolinking content - experiments in connecting virtual and physical places / ...
 
All change for WCAG 2.0 - what you need to know about the new accessibility g...
All change for WCAG 2.0 - what you need to know about the new accessibility g...All change for WCAG 2.0 - what you need to know about the new accessibility g...
All change for WCAG 2.0 - what you need to know about the new accessibility g...
 
Web Accessibility - an introduction / Salford Business School briefing / Univ...
Web Accessibility - an introduction / Salford Business School briefing / Univ...Web Accessibility - an introduction / Salford Business School briefing / Univ...
Web Accessibility - an introduction / Salford Business School briefing / Univ...
 
Ian Lloyd/Patrick H. Lauke: Accessified - practical accessibility fixes any w...
Ian Lloyd/Patrick H. Lauke: Accessified - practical accessibility fixes any w...Ian Lloyd/Patrick H. Lauke: Accessified - practical accessibility fixes any w...
Ian Lloyd/Patrick H. Lauke: Accessified - practical accessibility fixes any w...
 
The state of the web - www.salford.ac.uk / 2007
The state of the web - www.salford.ac.uk / 2007The state of the web - www.salford.ac.uk / 2007
The state of the web - www.salford.ac.uk / 2007
 
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
 
Getting touchy - an introduction to touch and pointer events / Frontend NE / ...
Getting touchy - an introduction to touch and pointer events / Frontend NE / ...Getting touchy - an introduction to touch and pointer events / Frontend NE / ...
Getting touchy - an introduction to touch and pointer events / Frontend NE / ...
 
Getting touchy - an introduction to touch and pointer events (1 day workshop)...
Getting touchy - an introduction to touch and pointer events (1 day workshop)...Getting touchy - an introduction to touch and pointer events (1 day workshop)...
Getting touchy - an introduction to touch and pointer events (1 day workshop)...
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 

Doing it in style - creating beautiful sites, the web standards way / WebDD / Reading / 3 February 2007

  • 1. Doing it in style CREATING BEAUTIFUL SITES, THE WEB STANDARDS WAY Patrick H. Lauke / WebDD / 3 February 2007
  • 2. Part one: web standards
  • 3. Visual aesthetics? “Beautiful sites” can be created with any technology... ● Table-based layouts ● Font tags ● Giant images ● etc Why bother with web standards/CSS?
  • 4. Web standard tenets Boil down to three things: ● Separation of content and presentation ● Valid (published grammar) ● Semantic markup/code
  • 5. Web standards elements Building a page by defining: ● What it is ● What it looks like
  • 6. Web standards and aesthetics? “You can't make good looking sites with web standards...”
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Traditional “old school” way Choice of markup purely down to their look ● <h1> is too big ... I'll use <h4> instead ● <blockquote> to indent ● More space between paragraphs ... add a few <p></p>
  • 14. Traditional “old school” way ...then sprinkle presentational markup on top ● forget <h4> ... <p><font size="+3" color="ffffff><b>...</b></font></p> ● <p>this is <b>important</b>.</p>
  • 15. Web standards process Distinct tasks: ● Mark up content in most appropriate elements - convey meaning, not look ● Apply styling (override browser defaults) Model, View, Controller (MVC) parallels?
  • 16. Why web standards Some advantages: ● Lighter code ● Easier to maintain ● Easier to change look/feel ● Multiple output media ● Accessibility ● SEO
  • 17. Part two: common pitfalls
  • 18. New technology, old habits <p><font size="+3" color="ffffff">...</font></p> <p><span style="font-size: 200%; color: #ffffff">...</span></p> <p style="font-size: 200%; color: #ffffff">...</p>
  • 19. Meaningless content Presentational: <p class="headingbig">Heading</p> <p>This is <span class="bold">important</span>.</p> <p class="headingsmall">Subheading</p> Semantic: <h1>Heading</h1> <p>This is <strong>important</strong>.</p> <h2>Subheading</h2>
  • 20. Non-semantic class/id names <p>I know <a href="..." class="red">CSS</a>.</p> .red { color: red; } I know CSS.
  • 21. Non-semantic class/id names? <p>I know <a href="..." class="red">CSS</a>.</p> .red { color: green; } I know CSS.
  • 22. Semantic class/id names! Presentational: <p class="boldred">Error: no entry found</p> Semantic: <p class="warning">Error: no entry found</p>
  • 23. Semantic digression... Conveys meaning? Don't forget to mark it up accordingly... <p class="warning"><strong>Error: no entry found</strong></p>
  • 24. Classitis – the “labelmaker” approach .nav { color: green; } <ul> <li><a href="..." class="nav"> ... </a></li> <li><a href="..." class="nav"> ... </a></li> <li><a href="..." class="nav"> ... </a></li> <li><a href="..." class="nav"> ... </a></li> <li><a href="..." class="nav"> ... </a></li> </ul>
  • 25. Classitis – cured #nav a { color: green; } <ul id="nav"> <li><a href="..."> ... </a></li> <li><a href="..."> ... </a></li> <li><a href="..."> ... </a></li> <li><a href="..."> ... </a></li> <li><a href="..."> ... </a></li> </ul> ● Be smart with your CSS ● Use semantic structure to your advantage
  • 26. Divitis – everything in neatly labelled boxes <div id="header"> <h1>Patrick's rants</h1> </div> <div id="navigation"> <ul>...</ul> </div> <div id="footer"> <p>©2007 ... </p> </div>
  • 27. Divitis – cured <h1 id="header">Patrick's rants</h1> <ul id="navigation">...</ul> <p id="footer">©2007 ... </p> ● Knowledge about your content to simplify markup. ● Not easy with generic template/CMS?
  • 29. Tables? “I've just learnt web standards and removed all tables from my site...”
  • 30. Tables (faked) Misguided zealots go too far... <div> <div> <span>First name</span> <span>Last name</span> </div> <div> <span>Patrick</span> <span>Lauke</span> </div> ... </div>
  • 31. Tables! Not all tables are evil... ● Tabular content (Excel spreadsheet) ● Best way to define relationship ● Accessibility
  • 32. Explicit semantics of tables <table> <tr> <td>Name</td> <td>Phone</td> <td>Email</td> </tr> <tr> <td>Patrick H. Lauke</td> <td>0161 2954779</td> <td>p.h.lauke@salford.ac.uk</td> </tr> ... </table>
  • 33. Explicit semantics of tables <table> <tr> <th scope="col">Name</th> <th scope="col">Phone</th> <th scope="col">Email</th> </tr> <tr> <th scope="row">Patrick H. Lauke</th> <td>0161 2954779</td> <td>p.h.lauke@salford.ac.uk</td> </tr> ... </table>
  • 34. Explicit semantics of tables <table> <thead> <tr> <th scope="col">Name</th> <th scope="col">Phone</th> <th scope="col">Email</th> </tr> </thead> <tbody> <tr> <th scope="row">Patrick H. Lauke</td> <td>0161 2954779</td> <td>p.h.lauke@salford.ac.uk</td> </tr> ... </tbody>
  • 35. Explicit semantics and styling With thead/tbody easy to nicely style table thead { background-color: #444; color: #fff; }
  • 36. Explicit semantics and styling Style th differently in table body thead { background-color: #444; color: #fff; } tbody th { font-weight: normal; text-align: left; }
  • 37. Explicit semantics and styling Underline each row table { border-collapse: collapse; } thead { background-color: #444; color: #fff; } tbody th { font-weight: normal; text-align: left; } tbody tr th, tbody tr td { border-bottom: 1px #444 solid; }
  • 38. Explicit semantics and styling Headless table table { border-collapse: collapse; } thead { position: absolute; top: 0; left: -999em; } tbody th { font-weight: normal; text-align: left; } tbody tr th, tbody tr td { border-bottom: 1px #444 solid; } ...but IE doesn't like that...
  • 39. Explicit semantics and styling Headless table (even in IE) table { border-collapse: collapse; } thead, thead tr { position: absolute; top: 0; left: -999em; } tbody th { font-weight: normal; text-align: left; } tbody tr th, tbody tr td { border-bottom: 1px #444 solid; }
  • 40. “Fluff” images Accessibility and ALT attributes: ● Convey purpose/meaning of images ● alt="" (null alt) if only decorative
  • 41. “Fluff” images <p class="warning"> <img src="warn.gif" ... alt="" /> <strong>Error: no entry found</strong> </p> p.warning { padding: 10px; border: 1px #000 solid; }
  • 42. “Fluff” images via CSS If only decorative... ● Decorative = presentation ● Add images as non-repeating CSS backgrounds
  • 43. “Fluff” images <p class="warning"> <strong>Error: no entry found</strong> </p> p.warning { padding: 10px; border: 1px #000 solid; background: url(warn.gif) no-repeat left top; }
  • 44. “Fluff” images <p class="warning"> <strong>Error: no entry found</strong> </p> p.warning { padding: 10px 10px 10px 50px; border: 1px #000 solid; background: url(warn.gif) no-repeat 10px center; }
  • 45. “Fluff” images <p class="warning"> <strong>Error: no entry found</strong> </p> p.warning { padding: 10px 10px 10px 50px; border: 1px #000 solid; background: url(warn.gif) no-repeat 10px center; min-height: 30px; }
  • 46. “Fluff” images Also works for inline elements <p>See our <a href=""><img src="qt.gif" alt="" ... /> quicktime video</a> for more information.</p>
  • 47. “Fluff” images <p>See our <a href="" class="qt">quicktime video</a> for more information.</p> a.qt { background: url(qt.gif) no-repeat left center; padding-left: 50px; } Beware of line-height, min-height won't work
  • 48. Softening up boxes Same principle, but for different purpose (“rounded boxes”) <blockquote><p>...</p></blockquote> blockquote { color: #fff; background-color: #73aeb5; }
  • 50. Softening up boxes Apply image flush to corner <blockquote><p>...</p></blockquote> blockquote { color: #fff; background: #73aeb5 url(corner.gif) no-repeat left top; }
  • 51. Softening up boxes More padding <blockquote><p>...</p></blockquote> blockquote { color: #fff; background: #73aeb5 url(corner.gif) no-repeat left top; padding: 20px; }
  • 52. Softening up boxes Changing box colour <blockquote><p>...</p></blockquote> blockquote { color: #fff; background: #f77921 url(corner.gif) no-repeat left top; padding: 20px; }
  • 54. Softening up boxes Naïve approach <blockquote><p>...</p></blockquote> blockquote { padding: 10px 20px 40px 20px; width: 210px; color: #333; background: url(bigquote.gif) no-repeat left top; }
  • 56. Softening up boxes “Sliding doors” <blockquote><p>...</p></blockquote> blockquote { padding: 10px 20px 40px 20px; width: 210px; color: #333; background: url(quote-top.gif) no-repeat left top; } blockquote p { background: url(quote-bottom.gif) no-repeat left bottom; }
  • 57. Softening up boxes <blockquote><p>...</p></blockquote> blockquote { padding: 20px 0 0 0; width: 210px; color: #333; background: url(quote-top.gif) no-repeat left top; } blockquote p { padding: 0 20px 80px 20px; background: url(quote-bottom.gif) no-repeat left bottom; }
  • 58. Image replacement Images used for headings etc ● Branding ● “Fancy” font ● Graphical buttons <h1><img src="heading.gif" alt="..." /></h1>
  • 59. Image replacement Potential issues? ● Accessibility (zoom) ● Multiple devices ● Images off
  • 60. Image replacement ● Mark up text version (proper semantics) ● Hide this text ● Put an image in its place
  • 61. Image replacement Wrap text in a span, apply background image <h1><span>Heading</span></h1> h1 { width: 350px; height: 75px; padding: 0; background: url(heading.gif) no-repeat left top; }
  • 62. Image replacement Hide the span <h1><span>Heading</span></h1> h1 { width: 350px; height: 75px; padding: 0; background: url(heading.gif) no-repeat left top; } h1 span { display: block; position: absolute; top: 0; left: -999em; }
  • 63. Image replacement Taking it further: more than just a heading <div id="header"> <h1>Heading</h1> <h2>Subheading</h2> ... </div> #header * { display: block; position: absolute; top: 0; left: -999em; } #header { ... }
  • 64. Image replacement (eXtreme) Too far? Whole page replaced... <body> <h1>Heading</h1> <h2>Subheading</h2> ... </body> body * { ... } body { ... }
  • 65. Image replacement issues From accessibility point of view: ● Images off / CSS on ● Text resizing / zoom Multiple (unskilled/WYSIWYG) authors? Backgrounds don't normally print
  • 66. Image replacement trick? Replacing an image with another image <h1><img src="logo_bw.png" ... /></h1> @media screen { h1 { ... background: url(logo_colour.jpg) ... } h1 img { ... /* off left */ ... } } Black/white logo for print, colour for on-screen
  • 67. Forms ● Traditionally laid out in tables ● Semantic “grey area”
  • 68. Forms Accessibility considerations: ● Form controls need associated label ● Grouping related controls ● Logical order
  • 69. Forms – associating labels Implicit: <label>First name: <input type="text" name="fname" /></label> Explicit: <label for="fname_id">First name:</label> <input type="text" name="fname" id="fname_id" />
  • 70. Forms – associating labels “Belt & braces” <label for="fname_id">First name: <input type="text" name="fname" id="fname_id" /> </label>
  • 71. Forms – “built-in” labels <input type="submit" value="Send application" />
  • 72. Forms – grouping related controls <p>What's your favourite colour?</p> <label for="col_r"> <input type="radio" name="col" id="col_r" value="red" /> Red</label> <label for="col_g"> <input type="radio" name="col" id="col_g" value="green" /> Green</label> Radio buttons, checkboxes, form sections
  • 73. Forms – grouping related controls <fieldset> <legend>What's your favourite colour?</legend> <label for="col_r"> <input type="radio" name="col" id="col_r" value="red" /> Red</label> <label for="col_g"> <input type="radio" name="col" id="col_g" value="green" /> Green</label> </fieldset>
  • 74. Forms – grouping related controls <fieldset> <legend>Billing address</legend> ... </fieldset> <fieldset> <legend>Shipping address</legend> ... </fieldset>
  • 75. Forms – basic styling <form ...> <label>...</label> <input /> <label>...</label> <input /> <label>...</label> <select> ... </select> <input type="submit" ... /> </form> label, input, select { display: block; }
  • 76. Forms – basic styling <form ...> <div><label>...</label> <input /></div> <div><label>...</label> <input /></div> <div><label>...</label> <select> ... </select></div> <input type="submit" ... /> </form>
  • 77. Forms – basic styling <form ...> <div><label>...</label> <input /></div> <div><label>...</label> <input /></div> <div><label>...</label> <select> ... </select></div> <input type="submit" ... /> </form> div input, div select { float: right; }
  • 78. Forms – basic styling <form ...> <div><label>...</label> <input /></div> <div><label>...</label> <input /></div> <div><label>...</label> <select> ... </select></div> <input type="submit" ... /> </form> div label { float: left; } div input, div select { float: right; }
  • 79. Forms – basic styling <form ...> <div><label>...</label> <input /></div> <div><label>...</label> <input /></div> <div><label>...</label> <select> ... </select></div> <input type="submit" ... /> </form> div label { float: left; clear: both; } div input, div select { float: right; }
  • 80. Forms – basic styling <form ...> <div><label>...</label> <input /></div> <div><label>...</label> <input /></div> <div><label>...</label> <select> ... </select></div> <input type="submit" ... /> </form> div { height: 1.3em; } div label { float: left; clear: both; } div input, div select { float: right; }
  • 81. Forms – basic styling <form ...> <div><label>...</label> <input /></div> <div><label>...</label> <input /></div> <div><label>...</label> <select> ... </select></div> <input type="submit" ... /> </form> div { height: 1.3em; } div input, div select { position: absolute; top: 0; left: 7em; }
  • 82. Forms – basic styling <form ...> <div><label>...</label> <input /></div> <div><label>...</label> <input /></div> <div><label>...</label> <select> ... </select></div> <input type="submit" ... /> </form> div { height: 1.3em; position: relative; } div input, div select { position: absolute; top: 0; left: 7em; }
  • 83. Forms – basic styling <form ...> ... <div><input type="checkbox" ... /> <label>...</label></div> ... </form> div { height: 1.3em; position: relative; } div input, div select { position: absolute; top: 0; left: 7em; }
  • 84. Forms – basic styling <form ...> ... <div class="check"><input type="checkbox" ... /> <label>...</label></div> ... </form> div { height: 1.3em; position: relative; } div input, div select { position: absolute; top: 0; left: 7em; } div.check input { position: relative; left: 0; }
  • 85. Forms – basic styling <form ...> <label> ... <input /></label> <label> ... <input /></label> <label> ... <select> ... </select> </label> <label class="check"><input /> ... </label> <input type="submit" ... /> </form> label { height: 1.3em; position: relative; } label input, label select { position: absolute; top: 0; left: 7em; } label.check input { position: relative; left: 0; }
  • 86. Forms – basic required fields <form ...> ... <label class="req"> ...<span>(required)</span> <input /></label> ... </form> ... label.req span { position: absolute; top: 0; left: -999em; } label.req { color: #f00; font-weight: bold; }
  • 87. Layout ● Most complex part of CSS ● Look at a micro-layout for general technique
  • 88. Layout Look at a micro-layout for general technique: <div class="example"> <img ... /> <p>Image caption</p> ... Main body of text ... </div> div.example { background-color: #fff9b2; padding: 20px; }
  • 89. Layout div.example { background-color: #fff9b2; padding: 20px 20px 20px 340px; position: relative; } div.capimage p { font-size: 0.6em; font-weight: bold; } div.capimage { position: absolute; top: 20px; left: 20px; }
  • 90. Layout div.example { background-color: #fff9b2; padding: 20px 340px 20px 20px; position: relative; } div.capimage p { font-size: 0.6em; font-weight: bold; } div.capimage { position: absolute; top: 20px; right: 20px; }
  • 92. Hurdles to adoption What's holding web standards and CSS back?
  • 93. Hurdles to adoption What's holding web standards and CSS back? ● Requires technical mind with aesthetic sensibility
  • 94. Hurdles to adoption What's holding web standards and CSS back? ● Designers don't understand the web
  • 95. Hurdles to adoption What's holding web standards and CSS back? ● Developers don't understand the web
  • 96. Hurdles to adoption What's holding web standards and CSS back? ● Old dogs and new tricks
  • 97. Hurdles to adoption What's holding web standards and CSS back? ● Difficult to get robust, general techniques
  • 98. Hurdles to adoption What's holding web standards and CSS back? ● Tools getting better, but still far off