PDA

View Full Version : CSS layout issue - IE. which hack?



big_britches
August 1st, 2006, 12:45 PM
Hi - I see that no less than 50% of the threads issued in this forum are covering a twist on my very question; I guess when I get a grasp on these issues I will have safely arrived in CSSdesignerland...

Here's a link to the site in question, which is wonderful in FF but shifted horribly to the right in IE:

http://strongfelt.com/v2/home.html

it works fine in every browser i've checked but IE, leading me to believe I need some sort of spacing/white space hack...but which one? I feel like I could get it through tinkering and reading online eventually, but due to serious time constraints and an anxious client, I gratefully and humbly defer to the experience of you fine folks. can anyone help me here? Thanks so much in advance...

oh - and here's my CSS. i know it's chunky, but i'm learning:
-------------------------
/* CSS Document */
/* HACK IE - regrettable but the easy way to make it behave ( for now) */
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden;}
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
/* End hide from IE-mac */
/* basic elements */
body {
background-image: url("images/blankBGimage.jpg");
background-repeat: no-repeat;
background-color: #CCC093;
background-position: top center;
background-attachment: fixed;
text-align: center;
font: normal 11px Arial, Helvetica, sans-serif;
margin-bottom: 30px;
padding: 0 12px 0 12px;
color: #2E2C22;
}
p {
font: normal 12px Arial, Helvetica, sans-serif;
margin: 0px;
padding: 0px 12px 0 12px;
text-align: left;
}
p2 {
font: normal 11px Arial, Helvetica, sans-serif;
font-weight: bold;
margin: 0px;
padding: 0px 12px 0 12px;
text-align: left;
}
h1 {
font: normal 11px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
margin: 0px;
background-color: none;
color: #2E2C22;
}
h2 {
font: normal 7px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
font-weight: bold;
padding: 10px 0 0 14px;
margin: 0px;
text-align: left;
background-color: none;
color: #2E2C22;
}
h3 {
font: normal 9px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
margin: 0px;
padding: 5px 0 5px 10px;
background-color: none;
color: #2E2C22;
}
h4 {
font: normal 12px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
font-weight: bold;
margin: 20px 0 10px 10px;
background-color: none;
color: #5C0101;
}
a:link {
font-weight: bold;
text-decoration: none;
background-color: none;
color: #2E2C22;
}
a:visited {
font-weight: bold;
text-decoration: none;
background-color: none;
color: #2E2C22;
}
a:hover, a:active {
text-decoration: none;
background-color: none;
color: #5C0101;
}


/* specific divs */
div#container {
top: 0px;
margin-left: auto;
margin-right: auto;
min-height: 800px;
width: 800px;
}

div#navbar2 {
background-image: url("images/subnav.gif");
background-repeat: no-repeat;
position: absolute;
top: 110px;
margin-left: 524px;
width: 97px;
height: 380px;
}

div#main {
position: absolute;
margin: 60px 0 30px 85px;
padding: 0px;
width: 524px;
text-align:left;
}

div#header {
background: transparent;
background-image: url("images/header.gif");
background-repeat: no-repeat;
margin: 0px;
width: 524px;
height: 106px;
}

div#nav_bio {
float:left;
margin: 87px 0px 4px 34px;
}

div#nav_statement {
float:left;
margin: 87px 0px 4px 16px;
}

div#nav_portfolio {
float:left;
margin: 87px 0px 4px 16px;
}

div#nav_resume {
float:left;
margin: 87px 0px 4px 105px;
}

div#nav_contact {
float:left;
margin: 87px 0px 4px 16px;
}

div#contentwell {
min-height: 440px;
width: 524px;
margin: 0px;
padding: 0px;
background-image: url("images/contentBG.gif");
background-repeat: repeat-y;
}

div#resnav {
width: 524px;
height: 50px;
margin: 0px;
padding: 0px;
}

div#resnavfoot {
width: 524px;
height: 75px;
margin: 0px;
padding: 0px;
}

div#footer {
text-align: center;
background-image: url("images/footer.gif");
background-repeat: no-repeat;
margin-bottom: 20px;
padding: 0px;
width: 524px;
height: 24px;
}

#footer a:link, #footer a:visited {
margin-right: 20px;
}

ul {
list-style-type: none;
padding: 0;
margin: 0;
text-align: center;
}

li {
margin: 28px 0 28px 0;
background-repeat: no-repeat;
}

zerokilled
August 1st, 2006, 09:16 PM
hi,

can you take a look at this site? http://rafael.adm.br/css_browser_selector/
maybe it can help you a lot. is a simple solution using javascript, but you don't have to touch the javascript code, just read how to use the solution and you are done. good luck!

ditt0
August 2nd, 2006, 12:22 AM
Change the html to:

<div id="container">
<div id="main">
<div id="header">
<div id="nav_bio"><a href="http://strongfelt.com/v2/bio2.html">BIO</a></div>
<div id="nav_statement"><a href="http://strongfelt.com/v2/statement.html">ARTIST STATEMENT</a></div>
<div id="nav_portfolio"><a href="http://strongfelt.com/v2/portfolionew.html">PORTFOLIO</a></div>
<div id="nav_resume"><a href="http://strongfelt.com/v2/resume2.html">RESUME</a></div>
<div id="nav_contact"><a href="http://strongfelt.com/v2/contact.html">CONTACT</a></div>
</div>
<div id="contentwell"><img src="home_files/homeimage.jpg" alt="" height="446" width="524" class="big_image" /></div>
</div>
<div id="navbar2">
<ul id="subnav">
<li><a href="http://strongfelt.com/v2/workshopdescr.html">WORKSHOP<br />DESCRIPTIONS</a></li>
<li><a href="http://strongfelt.com/v2/workshopsched.html">WORKSHOP<br />SCHEDULE</a></li>
<li><a href="http://strongfelt.com/v2/k12ed.html">K-12 ART<br />EDUCATION</a></li>
<li><a href="http://strongfelt.com/v2/feltprocess.html">FELTING<br />PROCESS</a></li>
<li><a href="http://strongfelt.com/v2/natdyeprocess.html">NATURAL DYE<br />PROCESS</a></li>
<li><a href="http://strongfelt.com/v2/acquisition.html">ACQUISITION<br />OF WORKS</a></li>
<li><a href="http://strongfelt.com/v2/care.html">CARE</a></li>
</ul>
</div>
<div id="footer">
<h2>© 2006 STRONG FELT, Lisa Klakulak. ALL RIGHTS RESERVED.</h2>
</div>
</div> and the css to:


body {
text-align: center;
font: normal 11px Arial, Helvetica, sans-serif;
margin:0 0 30px 0;
padding: 0;
color: #2E2C22;
background: #CCC093 url(blankBGimage.jpg) no-repeat fixed center top;
}
p {
font: normal 12px Arial, Helvetica, sans-serif;
margin: 0px;
padding: 0px 12px 0 12px;
text-align: left;
}
p2 {
font: normal 11px Arial, Helvetica, sans-serif;
font-weight: bold;
margin: 0px;
padding: 0px 12px 0 12px;
text-align: left;
}
h1 {
font: normal 11px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
margin: 0px;
background-color: none;
color: #2E2C22;
}
h2 {
font: normal 7px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
font-weight: bold;
padding: 10px 0 0 14px;
margin: 0px;
text-align: left;
background-color: none;
color: #2E2C22;
}
h3 {
font: normal 9px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
margin: 0px;
padding: 5px 0 5px 10px;
background-color: none;
color: #2E2C22;
}
h4 {
font: normal 12px Arial, Helvetica, sans-serif;
letter-spacing: 0px;
font-weight: bold;
margin: 20px 0 10px 10px;
background-color: none;
color: #5C0101;
}
a:link {
font-weight: bold;
text-decoration: none;
background-color: none;
color: #2E2C22;
}
a:visited {
font-weight: bold;
text-decoration: none;
background-color: none;
color: #2E2C22;
}
a:hover, a:active {
text-decoration: none;
background-color: none;
color: #5C0101;
}


/* specific divs */
div#container {
width: 640px;
margin:0 auto;
height:800px;
text-align:left
}

div#navbar2 {
background-image: url("subnav.gif");
background-repeat: no-repeat;
width: 97px;
height:380px;
float:left;
margin:175px 0 0 0;
}

div#main {
margin: 60px 0 0 0;
padding: 0px;
width: 524px;
text-align:left;
float:left;
}

div#header {
background: transparent;
background-image: url("header.gif");
background-repeat: no-repeat;
margin: 0px;
width: 524px;
height: 106px;
}
.big_image {
vertical-align: text-bottom;
}
div#nav_bio {
float:left;
margin: 87px 0px 4px 34px;
}

div#nav_statement {
float:left;
margin: 87px 0px 4px 16px;
}

div#nav_portfolio {
float:left;
margin: 87px 0px 4px 16px;
}

div#nav_resume {
float:left;
margin: 87px 0px 4px 105px;
}

div#nav_contact {
float:left;
margin: 87px 0px 4px 16px;
}

div#contentwell {
width: 524px;
margin: 0px;
padding: 0px;
background-image: url("contentBG.gif");
background-repeat: repeat-y;
}

div#resnav {
width: 524px;
height: 50px;
margin: 0px;
padding: 0px;
}

div#resnavfoot {
width: 524px;
height: 75px;
margin: 0px;
padding: 0px;
}

div#footer {
text-align: center;
background:url("footer.gif") no-repeat 0 0;
padding: 0px;
width: 524px;
height: 24px;
clear:both;
margin:0;
}
#footer a:link, #footer a:visited {
margin-right: 20px;
}

ul {
list-style-type: none;
padding: 0;
margin: 0;
text-align: center;
}

li {
margin: 28px 0 28px 0;
background-repeat: no-repeat;
}

It should work now, except the images paths in the css might be different.
And please don't use the hacks:)

big_britches
August 3rd, 2006, 01:06 PM
Change the html to:
and the css to:

It should work now, except the images paths in the css might be different.
And please don't use the hacks:)

------------------------------
I am greatly in your debt, Ditt0. This worked like a dream, and spawned an entire night's reading and studying online why the differences you implemented worked. I have much to learn yet, but it's getting better...

http://www.strongfelt.com/v2/home.html

one more mysterious issue: on the portfolio page, the entire portfolio is a .swf. I've used the new flashobject.js embed, so it isn't that...but for some reason, on SOME browsers, this .swf isn't there. I've seen it twice now - on the client's MAC laptop in FF, and on IE/PC 6 on ONE of the 3 PCs I've tested on. this is blowing my mind, as things work fine on other IE/PCs, and on every other FF I've tried, PC and MAC. This is probably a question for the flash forum, but I thought I'd address it here to save space...

Again, thanks so much for your response, Ditt0; I hope I get to repay you eventually...