h1
{color:
purple;
font-size:
175%;}
<style="text/css">...</style>
<link rel="stylesheet" type="text/css" href="site-style.css"> @import url(page.css);
<p style="background: yellow;">...</p>
font and its ilk
/* styles to visualize with borders */
table {border: 1px solid red; margin: 2px;}
th {border: 1px dashed red; padding: 2px;}
td {border: 1px dashed purple; padding: 2px;}
div {border: 1px dashed #888; padding: 2px;}
div div {border: 1px dotted #888;}
div div div {border: 1px dashed #BBB;}
div div div div {border: 1px dotted #BBB;}
div div div div div {border: 1px dashed #DDD;}
/* styles to visualize with backgrounds */
table {background: red; margin: 2px;}
th {background: #FCC; padding: 2px;}
td {background: #FCF; padding: 2px;}
div {background: #CBC; padding: 2px;}
div div {background: #BAB;}
div div div {background: #A9A;}
div div div div {background: #989;}
div div div div div {background: #878;}
div div div div div div {border: 1px dotted black;}
<p id="author-name">Eric A. Meyer</p> <a href="http://www.w3c.org/" class="external">W3C</a> <a href="http://www.cnn.com/" class="external">CNN</a>
| Top masthead | #masthead |
| Main table | #main |
| Left-side navigation | #nav |
| Current page link | #current |
| Main content | #content |
--(excerpt of markup)-- <table border="0" cellspacing="0" cellpadding="0" id="main"> <tr> <td id="nav"> <ul> <li id="current"><a href="index.html">UI7 East Home</a></li>
body {background: url(body-bg.gif); margin: 0; padding: 0;}
#main, #masthead {width: 800px;}
#main {background: white;}
#main td {vertical-align: top;}
#nav {width: 125px; padding: 16px 1px 3px; background: #F4D532;}
#nav ul {margin: 0; padding: 0 0 0 15px;}
#nav li {margin: 22px 0 0; text-indent: -15px;
font: bold 11px/12px Arial, Verdana, sans-serif; list-style-type: none; }
#nav li p {margin: 0; font: 11px "Times New Roman", Georgia, Garamond;
text-indent: 0;}
#nav li a {color: black; padding-left: 15px; word-spacing: -1px;
background: #F4D532 url(nav-bull.gif) 3px 50% no-repeat;}
#nav #current a, #nav a:hover {color: #CC203C;
background-image: url(nav-bull-cur.gif);}
#content {padding: 25px; width: 460px;}
#content ul {list-style: square url(red-dot.gif);
margin: 0 0 1.25em; padding: 0 10px;}
#content ul li {margin: 10px 0;
font: 11px Arial, Helvetica, Verdana, sans-serif;}
#content p {font: 12px Arial, Helvetica, Verdana, sans-serif;
margin: 1.25em 0;}
h1 {font: bold 34px/33px sans-serif; word-spacing: -2px; letter-spacing: 0.4px;
margin: 0.1em 0 0;}
h2 {font: bold 18px sans-serif; word-spacing: 1px; margin: 2em 0 0;}
h1, h2, h3, h4, h5, h6 {color: #CC203C;
font-family: Arial, Helvetica, Verdana, sans-serif;}
a:link {color: #4253B2;}
a:visited {color: #4253B2;}
a:hover {color: #CC203C;}
h2, etc.
#content .subhead1 {font-weight: 800; font-style: italic; margin-top: 2em;}
#content .regbasetext {font: bold 22px "Times New Roman", Georgia, Garamond, serif;
text-decoration: none; text-align: center; margin-bottom: 0;}
#content .regsubtext {nt-size: 11px; text-align: center; margin-top: 0;}
div for ease of styling
h3 to create the title
#expertlist div {border: 1px solid #467CC2; border-bottom-width: 10px;
margin: 40px 40px 0 0;}
#expertlist h3 {margin: 0; padding: 10px 1px 4px; background: #467CC2;
color: white; font-size: 14px; text-align: center;}
#expertlist p#first {border-width: 0;}
#expertlist p {font: 9px Verdana, sans-serif; margin: 0 3px;
padding: 1em 2px; border-top: 2px solid #467CC2; letter-spacing: -1px;
color: #666;}
p element
strong element to our advantage
#expertlist strong {font: bold 13px Times, "Times New Roman", serif;
text-decoration: underline; color: #444; letter-spacing: 0;}
#expertlist a {color: #666; text-decoration: none;}
#expertlist a:hover {color: #375E8F;}
#hosted {background: #F4D532;}
#bottomlinks {font: 12px Arial, Helvetica, Verdana, sans-serif;
text-align: center; padding-top: 1em; color: #4253B2;}
#credits {font: 500 10px Arial, Helvetica, Verdana, sans-serif;
word-spacing: 1px; padding: 10px 2px 50px 10px; background: #F4D532;}
divs
divs as well
div elements framing the layout
[[basic document structure, sans content, prepared for floats]] <body> <div id="masthead">...</div> <div id="main"> <div id="nav">...</div> <div id="expertlist">...</div> <div id="content"> ... <div id="bottomlinks">...</div> </div> <img id="hostedby"> <div id="credits">...</div> </div> </body>
div, we have three "columns"
<style type="text/css">
<!--
div#masthead, div#main {width: 800px;}
div#masthead img {vertical-align: bottom;}
div#nav {float: left; width: 140px;}
div#expertlist {float: right; width: 160px;}
div#expertlist {border: 1px solid #467CC2; border-bottom-width: 10px;
margin: 40px 40px 0 0;}
div#content {margin: 0 200px 0 145px;}
div#credits {width: 788px;}
img#hostedby {margin-top: -120px;}
-->
</style>
[[hack to "stretch" around floats]] <div style="clear: both;" </div>
[[basic document structure, sans content, prepared for positioning]] <body> <div id="masthead">...</div> <div id="main"> <div id="nav">...</div> <div id="content"> ... <div id="bottomlinks">...</div> </div> <div id="expertlist">...</div> <img id="hostedby"> </div> <div id="credits">...</div> </body>
<style type="text/css">
<!--
div#masthead, div#main {width: 800px;}
div#masthead img {vertical-align: bottom;}
div#main {position: relative;}
div#nav {position: absolute; top: 0; left: 0; width: 140px;}
div#expertlist {position: absolute; top: 0; right: 0; width: 160px;}
div#expertlist {border: 1px solid #467CC2; border-bottom-width: 10px;
margin: 40px 40px 0 0;}
div#content {margin: 0 200px 0 0; border-left: 142px solid #F4D532;}
div#credits {width: 788px;}
img#hostedby {position: absolute; left: 0; bottom: 0;}
-->
</style>
/* notables.css */
body {background: url(body-bg.gif); margin: 0; padding: 0;}
a:link {color: #4253B2;}
a:visited {color: #4253B2;}
a:hover {color: #CC203C;}
#main, #masthead {width: 800px;}
#main {background: white;}
#main td {vertical-align: top;}
#nav {width: 125px; padding: 16px 1px 3px; background: #F4D532;}
#nav ul {margin: 0; padding: 0 0 0 15px;}
#nav li {margin: 22px 0 0; font: bold 11px/12px Arial, Verdana, sans-serif;
list-style-type: none; text-indent: -15px;}
#nav li p {margin: 0; font: 11px "Times New Roman", Georgia, Garamond;
text-indent: 0;}
#nav li a {color: black; padding-left: 15px; word-spacing: -1px;
background: #F4D532 url(nav-bull.gif) 3px 50% no-repeat;}
#nav #current a, #nav a:hover {color: #CC203C; background-image: url(nav-bull-cur.gif);}
#content {padding: 25px;}
#content ul {list-style: square url(red-dot.gif);
margin: 0 0 1.25em; padding: 0 10px;}
#content ul li {margin: 10px 0;
font: 11px Arial, Helvetica, Verdana, sans-serif;}
#content p {font: 12px Arial, Helvetica, Verdana, sans-serif;
margin: 1.25em 0;}
h1 {font: bold 34px/33px sans-serif; word-spacing: -2px;
letter-spacing: 0.4px; margin: 0.1em 0 0;}
h2 {font: bold 18px sans-serif; word-spacing: 1px; margin: 2em 0 0;}
h1, h2, h3, h4, h5, h6 {color: #CC203C;
font-family: Arial, Helvetica, Verdana, sans-serif;}
#content .subhead1 {font-weight: 800; font-style: italic; margin-top: 2em;}
#content .regbasetext {font: bold 22px "Times New Roman", Georgia, Garamond, serif;
text-decoration: none; text-align: center; margin-bottom: 0;}
#content .regsubtext {nt-size: 11px; text-align: center; margin-top: 0;}
#expertlist div {border: 1px solid #467CC2; border-bottom-width: 10px;
margin: 40px 40px 0 0;}
#expertlist h3 {margin: 0; padding: 10px 1px 4px; background: #467CC2;
color: white; font-size: 14px; text-align: center;}
#expertlist p#first {border-width: 0;}
#expertlist p {font: 9px Verdana, sans-serif; margin: 0 3px;
padding: 1em 2px; border-top: 2px solid #467CC2; letter-spacing: -1px;
color: #666;}
#expertlist strong {font: bold 13px Times, "Times New Roman", serif;
text-decoration: underline; color: #444; letter-spacing: 0;}
#expertlist a {color: #666; text-decoration: none;}
#expertlist a:hover {color: #375E8F;}
#hosted {background: #F4D532;}
#bottomlinks {font: 12px Arial, Helvetica, Verdana, sans-serif;
text-align: center; padding-top: 1em; color: #4253B2;}
#credits {font: 500 10px Arial, Helvetica, Verdana, sans-serif;
word-spacing: 1px; padding: 10px 2px 50px 10px; background: #F4D532;}