13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

36<br />

Positioning elements<br />

While we're not trying to accomplish anything groundbreaking with the overall layout, it's worth reviewing how each major<br />

element is positioned before we move on to the nitty-gritty. First, clear the floats:<br />

.clearfix:after<br />

{content:".";<br />

display:block;<br />

height:0;<br />

clear:both;<br />

visibility:hidden;<br />

}<br />

.clearfix {display:inline-block;}<br />

/* Hides from IE-mac \*/<br />

.clearfix {display:block;}<br />

/* End hide from IE-mac */"<br />

body {<br />

background:#111 url(../i/bg_body.gif) repeat-x;<br />

margin:0;padding:0;<br />

font-family:'lucida grande',tahoma,sans-serif;<br />

font-size:small;<br />

}<br />

#wrapper {<br />

width:800px;<br />

}<br />

#content is set to float:left, causing it to enclose the two floats it contains (#content-primary and #sidebar-wrapper):<br />

#content {<br />

float:left;<br />

}<br />

#content-primary is also set to position:relative, allowing #sidebar-tab and #teaser to be positioned absolutely, but<br />

within the confines of their containing element. See Doug Bowman’s “Making Absolute Relative” (http://stopdesign.com/<br />

articles/absolute/) for a good overview of this technique.<br />

#content-primary {<br />

float:left;<br />

background:url(../p/homepage_photo.jpg) no-repeat;<br />

position:relative;<br />

height:549px;<br />

width:520px;<br />

padding:0;<br />

color:#fff;<br />

}<br />

h1#logo {<br />

position:absolute;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!