Forum Moderators: not2easy

Message Too Old, No Replies

divs behaving differently in IE and FF

trying to decipher our vendor's code

         

halfandhalf

8:56 pm on Jul 17, 2007 (gmt 0)

10+ Year Member



I have an image and a block of text, both in separate divs, and I'd like them to line up with each other. In Firefox everything looks great, but in IE/PC the bottom div is too far to the left. Does this have to do w/ the fact that there are two classes? (I'm not sure if I'm pasting in the right style, as they set it up w/ 3 stylesheets). Any guidance would be appreciated!

.col1, .col2, .col3 {
float: left;
position: relative;
}

.homepage .homeleft .homemainimg {
border-bottom-width: 10px;
border-bottom-style: solid;
width: 19.37em; /* 310px x 201px */
margin: 0em;
}

.homepage .contentcol dl {
font: normal .7em/1.2em Verdana, Arial, Helvetica, sans-serif;
border-width: 1px;
border-style: solid;
width: 27.5em;
margin: .5em 0em 0em 0em;

}

<div class="col2 contentcol">
<div class="homeleft">
<img src="/directory/images/homeimg" class="homemainimg" alt="" /> <dl>
<dd>here is my block of text</dd>
</dl>
</div>
<div class="clear"><!-- clear floats --></div>
</div>

londrum

9:07 pm on Jul 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i think you need to give us some more of the CSS.
have you got the CSS for the actual divs?

the code that you have posted so far mainly refers to the actual image (class 'homemainimg'), and the <dl>

the only bit that applies to the divs themselves is

.col1, .col2, .col3 {
float: left;
position: relative;
}

which doesn't give much of a clue!

halfandhalf

9:15 pm on Jul 17, 2007 (gmt 0)

10+ Year Member



Is this the line?

.homepage .contentcol dl dd {
padding: .5em 1em .5em 1em;
}

I haven't really used multiple classes much, so I'm not sure what to be looking for. PLMK. Thank you.

londrum

9:22 pm on Jul 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



the very last thing on the line is the thing to look for, so

.homepage .contentcol dl dd

just refers to the <dd>
you need the bits that refer to

.col2
.contentcol
.homeleft
.clear

but if there's a comma in the line, then it will also refer to the bit before the comma, so

.col1, .col2, .col3
refers to all of them... whereas
.col1 .col2 .col3
would just refer to .col3

halfandhalf

12:13 am on Jul 18, 2007 (gmt 0)

10+ Year Member



Thanks for helping me out:

.col1, .col2, .col3 {
float: left;
position: relative;
}

.threecol .col2 { /*background-color:#6f6;*/
width: 100%;
z-index: 3;
}

.twocol .col2 { /*background-color:#6f6;*/
width: 100%;
z-index: 3;
}

.onecol .col2 { /*background-color:#6f6;*/
width: 100%;
z-index: 3;
}

.contentcol {
font-family: Verdana, Arial, Helvetica, sans-serif;
}

@media print {
.contentcol {width:auto;display:block;z-index:500;}
}

.homepage .contentcol .homeleft {
width: 20.1em;
width: 19.37em; /* 310px x 201px */
margin-left: 1.9em;
}

.homepage .contentcol .homeleft {
border-top-width: 0px;
border-top-style: solid;
}

.clear { height: 0px; margin: 0px;padding: 0px;font-size: 0px;clear: both; }

.contentcol .clear {
font-size:0px;
margin:0;padding:0;
clear:both;
}