|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Not now, I'm kinda busy.
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2004
Location: Oakland, California
Posts: 831
|
Notice: This is a discussion thread for comments about the SitePoint article, Breaking Out of the Box.
__________ Wow! I really enjoyed this article. It's laid out so simply, making it easy to understand how a few simple flourishes can make a design really stand out. Thanks! |
|
|
|
|
|
#2 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Not to detract from the article but just in case anyone is trying the code out and wondering why the code isn't displaying correctly in ie6 and under you need to address the double margin bug on outer floats and use these fixes (see CSS faq on floats for the why and wherefore.).
Code:
#content-primary {
float: right;
margin: 24px;
width: 720px;
display:inline;
}
#content-secondary {
float: right;
margin: 24px;
width: 144px;
display:inline;
}
Code:
#content-primary {
float: right;
margin: 12px 24px 60px 24px;
width: 528px;
display:inline;
}
#content-secondary {
float: right;
margin: 30px 216px 60px 24px;
width: 144px;
font-size: 11px;
color: #300;
display:inline
}
These were just minor issues on an otherwise good article that I thought I'd mention before anyone else piped up ![]() |
|
|
|
|
|
#3 |
|
SitePoint Enthusiast
![]() Join Date: Mar 2006
Posts: 42
|
I used the image on the second page to do the faux column technique. Thing is the image was 400px wide.
Would it be better to position the image or mod it to say 200px? I always like to try out tutorials as its the best way to learn (for me anyway). So far the book has a thumbs up from me. Also - some observations and queries: - Why wasn't '.clear' utilised in a div? Afterall it was in the css. - I never really understood why 'footer p' padding was: padding: 132px 24px 0 24px; (on page 3). I thought it could have been 132px, 0, 0, 24px. (sorry this is really splitting hairs). - Its a shame some of the gifs/pngs were not on screen (such as ornament.gif and bg.gif) so I could have saved/resized and included them. - First time ive seen text-shadow being used. Last edited by pug2112; May 17, 2007 at 09:31. |
|
|
|
|
|
#4 | |
|
8.12.13.18
![]() ![]() Join Date: Nov 2006
Location: Silures
Posts: 2,724
|
Quote:
![]() Andy |
|
|
|
|
|
|
#5 |
|
SitePoint Member
Join Date: May 2006
Location: Chesterfield
Posts: 24
|
Thanks Jina,
A working example would round off this excellent tutorial very nicely and make it a very good training excercise. Thanks Again! |
|
|
|
|
|
#6 |
|
Non-Member
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Posts: 607
|
Jina is my role model w00t
Love you Jina, keep it real baby. |
|
|
|
|
|
#7 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Hi Jina,
Quote:
![]() It would have taken a couple of seconds to fix and I have to wonder what testing process you went through with this when ie6 is still the most widely used browser. Did you not test in IE6? While in general I think the article was pretty good and offers good advice I still think you need to be careful in offering code that doesn't work cross-browser, or at least mention the problems even if you don't want to address them in code. Sorry if this sounds harsh but its just that I care about my CSS ![]() |
|
|
|
|
|
|
#8 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Quote:
![]() As I said, apart from that it was a good article ![]() |
|
|
|
|
|
|
#9 |
|
SitePoint Member
Join Date: May 2006
Location: Chesterfield
Posts: 24
|
Thank you Jina for the download.
I have tried Paul O'B's fix and this has corrected the position of the left column layout. However in IE6 the left hand side of the main picture and the little swirls do not display. The icture doesn't extend outside of the text, it is just cropped. No left border. Any thoughts? |
|
|
|
|
|
#10 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Hi,
Quote:
There are also "haslayout" issues (see faq) on the h1 and h2 and usually occurs when an elements dimensions are defined by margins alone. Therefore you need the following fixes to correct all the above. ![]() Code:
/* mac hide \*/
h1,h2,h3,#content-primary img {position:relative;}
h1,h2,h3 {height:1%}
/* end hide */
|
|
|
|
|
|
|
#11 |
|
SitePoint Member
Join Date: Apr 2007
Posts: 13
|
Done a bit of tinkering around with the code from the article. This works in IE6 and Firefox:
* { margin: 0; padding: 0; } body { background: #eee url(bg.gif) 0 100% repeat-x; font: 12px/18px "Lucida Grande", Verdana, sans-serif; text-align: center; color: #333; } a:link, a:visited { color: #633; } a:hover { color: #966; } h1 { margin-bottom: 11px; margin-left: -108px; padding: 15px 0 21px 108px; border-bottom: 1px solid #ccc; font: normal italic 1.5em/18px Georgia, serif; color: #633; } h2, h3{ font-weight: normal; font-size: 1em; line-height: 18px; } h2 { margin-left: -204px; padding: 10px 0 20px 204px; background: url(h2_ornament.gif) 3px 0 no-repeat; font-size: 1.25em; text-transform: uppercase; color: #999; } h3 { padding-bottom: 6px; font-weight: bold; text-transform: uppercase; letter-spacing: -1px; color: #633; } #wrap { background: url(wrap.gif) repeat-x; } #page { margin: 0 auto; width: 960px; background: #fff url(page.gif) repeat-y; text-align: left; } #header { height: 192px; background: #966 url(header.gif) bottom no-repeat; } #header p { float: left; padding: 60px 24px 24px 126px; font-size: 1.5em; line-height: 1em; color: #fff; } #header ul { padding-top: 62px; padding-right: 12px; text-align: right; list-style: none; } #header li { display: inline; margin: 0 12px; } #header li a { font-size: 1.25em; line-height: 1em; text-decoration: none; color: #fff; } #header li a:hover { color: #300; } #content-primary { float: right; margin: 12px 24px 60px 24px; width: 528px; display:inline; } #content-primary p { padding-bottom: 18px; } #content-primary img { float: left; margin: -6px 18px 0 -114px; padding: 3px; border: 3px solid #eee; background: #fff; } #content-secondary { float: right; display:inline; margin: 30px 216px 60px 24px; width: 144px; font-size: 11px; color: #300; } #content-secondary p { padding-bottom: 18px; } #footer { clear: right; height: 192px; background: #333 url(footer.gif) top no-repeat; font-size: 10px; line-height: 1em; text-shadow: 1px 1px 1px #333; color: #fff; } #footer a:link, #footer a:visited { color: #c99; } #footer p { padding: 132px 24px 0 24px; } .clear { clear: both; } <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Example Layout</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="style.css"/> </head> <body> <div id="wrap"> <div id="page"> <div id="header"> <p>Header content</p> <ul> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> </div> <div id="content-primary"> <h1>Welcome to my awesome website.</h1> <h2>Indeed, this is an awesome website.</h2> <p><strong>Primary content.</strong> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse pharetra, arcu in dapibus sagittis, felis leo rhoncus erat, non porttitor urna libero vitae nibh. Ut convallis eros sed magna.</p> <img src="photo.jpg" alt="" /> <p>Aenean enim purus, adipiscing a, vehicula ut, tempor vitae, justo. Nam laoreet mauris vitae elit. Vivamus eros quam, euismod bibendum, pellentesque ut, tristique ut, nisl. <a href="#">Vestibulum ante ipsum primis</a> in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse non metus. Nullam tempor dictum sapien. Duis enim. In ligula. Cras ut enim. Sed dapibus ante in eros. Nulla facilisi. In rhoncus eleifend nunc. Sed risus nulla, pretium in, porta eget, lacinia eu, nunc. In hac habitasse platea dictumst. Vestibulum feugiat lectus et justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed aliquet dolor nec ipsum.</p> <h2>Oooh, more copy…</h2> <p><a href="#">Ut erat nibh</a>, aliquet ut, congue at, tempus in, nunc. Ut aliquet leo et lectus volutpat molestie. Vivamus nunc. Nulla facilisi. Suspendisse dictum nunc tempus elit. Nullam urna quam, bibendum quis, tincidunt a, nonummy euismod, metus. Etiam convallis, dui venenatis feugiat elementum, justo lacus lobortis libero, vel iaculis nibh lectus eu urna. Vivamus arcu. In facilisis quam et lacus. Suspendisse sit amet neque ac enim lobortis ullamcorper. Etiam faucibus sapien ut nunc. Nullam consectetuer vehicula arcu.</p> </div> <div id="content-secondary"> <h3>Important Information</h3> <p><strong>Secondary content.</strong> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse pharetra, arcu in dapibus sagittis, felis leo rhoncus erat, non porttitor urna libero vitae nibh. Ut convallis eros sed magna. Aenean enim purus, adipiscing a, vehicula ut, tempor vitae, justo. Nam laoreet mauris vitae elit. This is interesting information. Ut erat nibh, aliquet ut, congue at, tempus in, nunc. Ut aliquet leo et lectus volutpat molestie. Vivamus nunc. <a href="#">Read more →</a> </p> </div> <div id="footer"> <p>Photograph by <a href="http://jinabolton.com">Jina Bolton</a>.</p> </div> </div> </div> </body> </html> |
|
|
|
|
|
#12 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Hi MarcusVitruvius,
You just needed the changes I offered in posts #3 and post #16 and it will look the same in Firefox and IE. ![]() The code you posted above is still not working in IE because all the images are hidden due to the negative margins as explained in my other post. This is the working code: Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Example Layout</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
* {
margin: 0;
padding: 0;
}
body {
background: #eee url(bg.gif) 0 100% repeat-x;
font: 12px/18px "Lucida Grande", Verdana, sans-serif;
text-align: center;
color: #333;
}
a:link, a:visited {
color: #633;
}
a:hover {
color: #966;
}
h1 {
margin-bottom: 11px;
margin-left: -108px;
padding: 15px 0 21px 108px;
border-bottom: 1px solid #ccc;
font: normal italic 1.5em/18px Georgia, serif;
color: #633;
}
h2, h3{
font-weight: normal;
font-size: 1em;
line-height: 18px;
}
h2 {
margin-left: -204px;
padding: 10px 0 20px 204px;
background: url(h2_ornament.gif) 3px 0 no-repeat;
font-size: 1.25em;
text-transform: uppercase;
color: #999;
}
h3 {
padding-bottom: 6px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: -1px;
color: #633;
}
#wrap {
background: url(wrap.gif) repeat-x;
}
#page {
margin: 0 auto;
width: 960px;
background: #fff url(page.gif) repeat-y;
text-align: left;
}
#header {
height: 192px;
background: #966 url(header.gif) bottom no-repeat;
}
#header p {
float: left;
padding: 60px 24px 24px 126px;
font-size: 1.5em;
line-height: 1em;
color: #fff;
}
#header ul {
padding-top: 62px;
padding-right: 12px;
text-align: right;
list-style: none;
}
#header li {
display: inline;
margin: 0 12px;
}
#header li a {
font-size: 1.25em;
line-height: 1em;
text-decoration: none;
color: #fff;
}
#header li a:hover {
color: #300;
}
#content-primary {
float: right;
margin: 12px 24px 60px 24px;
width: 528px;
display:inline;
}
#content-primary p {
padding-bottom: 18px;
}
#content-primary img {
float: left;
margin: -6px 18px 0 -114px;
padding: 3px;
border: 3px solid #eee;
background: #fff;
}
/* mac hide \*/
h1,h2,h3,#content-primary img {position:relative;}
h1,h2,h3 {height:1%}
/* end hide */
#content-secondary {
float: right;
margin: 30px 216px 60px 24px;
width: 144px;
font-size: 11px;
color: #300;
display:inline;
}
#content-secondary p {
padding-bottom: 18px;
}
#footer {
clear: right;
height: 192px;
background: #333 url(footer.gif) top no-repeat;
font-size: 10px;
line-height: 1em;
text-shadow: 1px 1px 1px #333;
color: #fff;
}
#footer a:link, #footer a:visited {
color: #c99;
}
#footer p {
padding: 132px 24px 0 24px;
}
.clear {
clear: both;
}
</style>
</head>
<body>
<div id="wrap">
<div id="page">
<div id="header">
<p>Header content</p>
<ul>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
<div id="content-primary">
<h1>Welcome to my awesome website.</h1>
<h2>Indeed, this is an awesome website.</h2>
<p><strong>Primary content.</strong> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse pharetra, arcu in dapibus sagittis, felis leo rhoncus erat, non porttitor urna libero vitae nibh. Ut convallis eros sed magna.</p>
<img src="photo.jpg" alt="" />
<p>Aenean enim purus, adipiscing a, vehicula ut, tempor vitae, justo. Nam laoreet mauris vitae elit. Vivamus eros quam, euismod bibendum, pellentesque ut, tristique ut, nisl. <a href="#">Vestibulum ante ipsum primis</a> in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse non metus. Nullam tempor dictum sapien. Duis enim. In ligula. Cras ut enim. Sed dapibus ante in eros. Nulla facilisi. In rhoncus eleifend nunc. Sed risus nulla, pretium in, porta eget, lacinia eu, nunc. In hac habitasse platea dictumst. Vestibulum feugiat lectus et justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed aliquet dolor nec ipsum.</p>
<h2>Oooh, more copy…</h2>
<p><a href="#">Ut erat nibh</a>, aliquet ut, congue at, tempus in, nunc. Ut aliquet leo et lectus volutpat molestie. Vivamus nunc. Nulla facilisi. Suspendisse dictum nunc tempus elit. Nullam urna quam, bibendum quis, tincidunt a, nonummy euismod, metus. Etiam convallis, dui venenatis feugiat elementum, justo lacus lobortis libero, vel iaculis nibh lectus eu urna. Vivamus arcu. In facilisis quam et lacus. Suspendisse sit amet neque ac enim lobortis ullamcorper. Etiam faucibus sapien ut nunc. Nullam consectetuer vehicula arcu.</p>
</div>
<div id="content-secondary">
<h3>Important Information</h3>
<p><strong>Secondary content.</strong> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse pharetra, arcu in dapibus sagittis, felis leo rhoncus erat, non porttitor urna libero vitae nibh. Ut convallis eros sed magna. Aenean enim purus, adipiscing a, vehicula ut, tempor vitae, justo. Nam laoreet mauris vitae elit. This is interesting information. Ut erat nibh, aliquet ut, congue at, tempus in, nunc. Ut aliquet leo et lectus volutpat molestie. Vivamus nunc. <a href="#">Read more →</a> </p>
</div>
<div id="footer">
<p>Photograph by <a href="http://jinabolton.com">Jina Bolton</a>.</p>
</div>
</div>
</div>
</body>
</html>
Hope it helps ![]() |
|
|
|
|
|
#13 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Ken and Emily - read my posts above which offer simple fixes for the problems mentioned
![]() |
|
|
|
|
|
#14 |
|
In memoriam
![]() ![]() Join Date: May 2006
Location: Aurora, Illinois
Posts: 15,648
|
That's the universal selector and is used to strip the margins and padding from everything, removing any chance of the browsers using their own default margins and padding on elements (like lists), which in turn turns the control of the styling of these elements over to the Web designer (where it, in this case anyway, belongs).
|
|
|
|
|
|
#15 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Martine - Read my posts above which address all these issues
![]() |
|
|
|
|
|
#16 |
|
SitePoint Member
Join Date: Sep 2007
Posts: 24
|
Thanks for this tutorial Jina (and thanks for the IE fixes Paul O'B).
I wanted to make a really simple portal site for myself that links to all my sites. So since this site would really be lacking in content, I wanted to kind of make up for it in a bit of a innovative design. The ideas in this tutorial (off-centering headers and images, ornamental background images, and the abstract header/footers) will hopefully do the trick. My goal is to have a similar 4 pane layout (header, footer, primary, secondary). I want to do just two pages. Page 1 would be the description of the site, and Page 2 would be form-powered contact page (which I hope to design following the other sitepoint tutorial here: http://www.sitepoint.com/article/fancy-form-design-css). In my planned version though, I'm going to be keeping the off centered images in the content-secondary div because I want the content-primary window to be what changes between page 1 and page 2. Hopefully it won't be too hard to switch this around. I'm not sure if I like the swirly borders that Gina used for her site though. Any suggestions on other borders that are out there? I'd like to have something like this, but would like to see some more to get some ideas. |
|
|
|
|
|
#17 |
|
SitePoint Member
Join Date: Oct 2007
Posts: 1
|
I think i was a wonderful article.
I had been using Tables in GoLive for about a year to build website. Then I read this article and it haven't built another website with tables! I have come across a little glitch in one of the sites I am building. I have tried a few things to try to fix this problem, but still nothing! and it is only happening in windows Vista! So here is my predicament: - my footer is moving up along the right side on my body text. HTML4Strict Code:
CSS Code:
I know it is probably something super simple that will fix this, but I can't figure it out. Any help will be great! |
|
|
|
|
|
#18 |
|
padawan
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Victoria, Australia
Posts: 2,734
|
Hi Kathy@rubic, and welcome to Sitepoint
![]() this probably doesn't belong in this thread but I tested your code and the footer seems fine in IE7 and firefox. Which browser are you having trouble with? Validate your html to a strict doctype also, |
|
|
|
|
|
#19 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,615
|
Quote:
I did notice that you had an ID that was being used though. Code:
<div id="conent"> |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 03:25.

















Hybrid Mode
