PDA

View Full Version : CSS line spacing problem


rollinlow54
10-11-2005, 03:18 AM
hey guys i'm having a problem with CSS line spacing. firefox is displaying correctly of course, and IE is scrunching the lines closer. here is an example (firefox on the right, IE on the left):

http://graffetto.com/chops/lineproblem2.gif

here is the CSS:

#galleriesTextContainer
{
height: 130px;
margin: 0px;
padding: 0px;
margin-left: 8px;
line-height: 8pt;
}

.galleriesText
{
margin: 0px;
padding: 0px;
color: white;
font-family: Arial, Verdana, Sans Serif;
font-size: 11px;
}

<div id="galleriesTextContainer">
<span class="galleriesText">dolphy day 2005 (132 images)<br />dolphy day 2004 (101 images)<br />buffalo wild wings (47 images)<br />lemoyne 2005 (425 images)<br />lemoyne 2004 (28 images)<br />lemoyne 2003 (147 images)<br />syracuse nationals 2004 (43 images)<br />nyc / jersey 2005 (245 images)<br />minutes monte (29 images)<br />my truck (67 images)<br />phil's t-type (70 images)
</span>
</div>

rpgfan3233
10-11-2005, 03:22 AM
Maybe add the same 'line-height' to .galleriesText ?

rollinlow54
10-11-2005, 03:24 AM
Maybe add the same 'line-height' to .galleriesText ?
tried that, but then firefox ignores the linespacing attribute. :o

Tynan
10-11-2005, 10:11 AM
had a quick fiddle with my minimal knowledge, put all the style into the css for the div and it's fine for me. Try this for your css for the div and remove the span, if I'm missing something, sorry

#galleriesTextContainer
{
height: 130px;
margin: 0px;
padding: 5px;
margin-left: 8px;
background-color:#FF9500;
font: 8pt/9pt arial,helvetica,sans-serif;
}

ronaldb66
10-11-2005, 03:19 PM
The pt unit is best not used for screen since it makes little sense in a non-print environment and probably is root to the difference in interpretation; try a px size, or better still, one that is relative to the chosen font size.
You'll find all the flavours here (http://www.w3.org/TR/2004/CR-CSS21-20040225/visudet.html#propdef-line-height).

Maybe add the same 'line-height' to .galleriesText ?

Since the .galleriesText span is a child of the #galleriesTextContainer div, specifying line-height for the parent should be inherited by the child; repeating it would be unnecessary in this case.

Tynan
10-11-2005, 04:04 PM
thanks ronald, my mistake, I did kinda know that, I work in print and everything is pts, of course px, haven't quite fatomned the other ones yet

rollinlow54
10-11-2005, 07:00 PM
thanks guys for the tips.. i used the 8pt/9pt to straighten it out for now but i'm going to play around with the other attributes

Dave Smith-Haye
10-11-2005, 09:23 PM
firefox is displaying correctly of course, and IE is scrunching the lines closer

SImple solution, let the IE people view it crappily, while us FF people look at it properly.

JamieR
10-11-2005, 09:43 PM
yeah well until M$ shape up IE into what it should be, we're buggered cos we still have to code for a old and dodgy browser.

rollinlow54
10-11-2005, 10:22 PM
yeah well until M$ shape up IE into what it should be, we're buggered cos we still have to code for a old and dodgy browser.
yep, or until we can get 90% of the population to switch to ffox :thumbsup:

Dave Smith-Haye
10-11-2005, 10:26 PM
IE 7 will be the last IE, and it's the equivelent(spelling?) go firefox 2.