2. HTML5 // Cleaning redundancy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
9. HTML5 // New elements
<header> <video>
<nav> <figure>
<section> <footer>
<article> <time>
<aside> <datalist>
To check all elements: http://joshduck.com/periodic-table.html
18. CSS // Pseudo classes
Relational Links Input Text
:not :link :focus :first-letter
:empty :visited :target :first-line
:hover :enabled :lang
:active :disabled ::selection
Position :checked
:first-child
:last-child
:nth-child(n)
:nth-of-type(n)
BAD NEWs...
:first-of-type
:last-of-type
Most of these don’t
:nth-last-of-type(n)
:nth-last-child(n)
:only-of-type
work on old popular
browsers! :(
19. CSS // Pseudo classes
Relational Links Input Text
:not :link :focus :first-letter
:empty :visited :target :first-line
:hover :enabled :lang
:active :disabled ::selection
Position :checked
:first-child
:last-child
:nth-child(n)
:nth-of-type(n)
SOLUTION?
:first-of-type
:last-of-type
Use more markup or
:nth-last-of-type(n)
:nth-last-child(n) try Selectivizr.com
:only-of-type
20. CSS // Pseudo classes
Relational Links Input Text
:not :link :focus :first-letter
:empty :visited :target :first-line
:hover :enabled :lang
:active :disabled ::selection
Position :checked
:first-child
:last-child
:nth-child(n)
:nth-of-type(n)
GOOD NEWS...
:first-of-type
:last-of-type
They all work great on
:nth-last-of-type(n)
:nth-last-child(n)
:only-of-type
IE9, webkit browsers,
Firefox and Opera...
21. CSS // Pseudo classes
Relational Links Input Text
:not :link :focus :first-letter
:empty :visited :target :first-line
:hover :enabled :lang
:active :disabled ::selection
Position :checked
:first-child
:last-child
:nth-child(n)
:nth-of-type(n)
GOOD NEWS...
:first-of-type
:last-of-type
... meaning, very suitable
:nth-last-of-type(n)
:nth-last-child(n)
:only-of-type
to work on mobile
browsers :)
24. CSS // Some examples
“What goes around comes around”
<blockquote>
HTML <p>What goes around comes around</p>
</blockquote>
p:before { p:after {
CSS content:’”’;
color:light-green;
content:’”’;
color:light-green;
} }
25. CSS // Some examples
i WARNING!
HTML <p class=”warning”>Warning!</p>
p:before {
CSS content:””;
background:url(warning-icon.png) 0 0 no-repeat;
display:inline-block;
margin-right:10px;
}
26. CSS // Some examples
i SIGN UP HERE
HTML <p class=”sign-up”>sign up here</p>
CSS .sign-up:before {
content:””;
background:url(warning-icon.png) 0 0 no-repeat;
display:inline-block;
margin-right:10px;
}
.sign-up:after {
content:””;
background:url(arrow.png) 0 0 no-repeat;
position:absolute;
bottom:-15px; left:50%;
}
27. CSS // Some examples
i SIGN UP HERE
HTML <p class=”sign-up”>sign up here</p>
CSS .sign-up:before {
/* same code as previous slide */
}
.sign-up:after {
content:””;
position:absolute; bottom:0; left:50%;
width: 0;
height: 0;
border-left: 15px solid transparent;
ro w im g!
}
border-right: 15px solid transparent;
border-top: 30px solid orange;
no ar