CSS help *new question*

BeauJangles

Lifer
Aug 26, 2001
13,941
1
0

jjones

Lifer
Oct 9, 2001
15,424
2
0
Okay, this works for both IE and Firefox:

Add float: left; to .newsouter

Delete all properties for .stories_left

Change .stories_right to equal this:

.stories_right {
float: right;
margin-left: 35px;
width: 50%
}

By the way, you could have .stories_left at 50% and use padding instead of margins and it shows up right in IE but Firefox looks bad as the boxes still seem to be over-running each other. This appears to be a CSS bug in Firefox that extends the box beyond 50% as if you were using margins, not padding.
 

WillyF1uhm1

Senior member
Aug 10, 2001
407
0
0
There is indeed a difference between Firefox and IE.
AFAIK Firefox and Mozilla add the margins and padding to the total width (according to w3c standards.) while IE doesn't.
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
Really? I know margins add to the box but I thought padding was supposed to be from the edge of the box inwards, not increasing the box size.

Edit: I just reviewed the CSS spec and you're right. The dimensions specified by width is the actual box size, then padding is added to that, then the border, then margins; all three properties are outside the box. IE is the one that is wrong about the spec.
 

ivwshane

Lifer
May 15, 2000
33,369
16,751
136
I'm a noob too but could you then set the padding to 0 so that both IE and FF display it the same?
 

Nextman916

Golden Member
Aug 2, 2005
1,428
0
0
lol i came in to this thread thinking it was CS:Source, which im sure many others did...........
 
Jun 4, 2005
19,723
1
0
Originally posted by: Nextman916
lol i came in to this thread thinking it was CS:Source, which im sure many others did...........

Yet another reason why we need to split these forums. :roll:
 

FeuerFrei

Diamond Member
Mar 30, 2005
9,144
929
126
Originally posted by: jjones
Really? I know margins add to the box but I thought padding was supposed to be from the edge of the box inwards, not increasing the box size.

Edit: I just reviewed the CSS spec and you're right. The dimensions specified by width is the actual box size, then padding is added to that, then the border, then margins; all three properties are outside the box. IE is the one that is wrong about the spec.

Gahh, so frustrating. I had to wrestle with that today. Firefox pisses me off. Or at least the specs!
What if you want to stack two or more <divs> and make them equal outer width with each having different padding or border thickness??? You can't in Firefox, the widths will vary according to amount of padding and screw up a neat stack. Same problem horizontally too. Firefox demands equal padding/border thickness if you want equal overall width. :|

I.E. renders stuff the way you intend it. :thumbsup:
 
Jun 4, 2005
19,723
1
0
No. IE renders the stuff the way they would like to see it. Firefox handles CSS the way it's supposed to be, or at least, as close to it as they can.
 

BeauJangles

Lifer
Aug 26, 2001
13,941
1
0