13 replies [Last post]
arginine
arginine's picture
Offline
newbie
Last seen: 10 years 23 weeks ago
Timezone: GMT+2
Joined: 2008-08-14
Posts: 2
Points: 0

Hello all,

THis is my firt post on this forum.

I would like to setup a "small linebreak" (3px) to separate tables or whatever using this css class:

.small_linebreak { line-height: 3px; }

Then in my html file:

<span class='small_linebreak'>&nbsp;</span>

It works perfectly in FF (MacOS X and Windows), Safari, IE7 (windows) but NOT UNDER IE6 ...

some of you had an idea why ?

F.

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

Welcome. Checked local only

Welcome.

Checked local only in IE/5.01 through IE/7.0, Mac Safari, Mac Opera, Mac FF/3.0.1, and Camino.
Change span to division. Line-height takes no unit of measure-- it's a raw number.

CSS
.lead { line-height:0.25; }
HTML
<div class="lead">&nbsp;</div>

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

it does take lengths, it's

:? it does take lengths, it's only advisable to use a unitless value as it's a computed value and you don't particularly want to be passing down set values where a relative measure might have been used for font size.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

You want to try that in

You might want to try that in plain English.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

David Laakso wrote:You might

David Laakso wrote:

You might want to try that in plain English.

Not really, too tired Smile

You can state pixels if you wish however if the line height is inherited by a child and that child sets a new font-size then the line-height won't adjust accordingly but remain fixed at the pixel value, consequence? possible illegible lines of text where spacing is too small - or large

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

All versions of Opera and IE

All versions of Opera and IE "trip on" (they are unable to adjust properly) line-height set in pixels.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Not sure what that has to do

Not sure what that has to do with the original statement? thought it was to do with whether line-height took a length value :shrug:

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

arginine
arginine's picture
Offline
newbie
Last seen: 10 years 23 weeks ago
Timezone: GMT+2
Joined: 2008-08-14
Posts: 2
Points: 0

Hi, thanks and lot it works.

Hi, thanks and lot it works. I'll never though about this "unit" thing.

F

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

Hugo wrote:Not sure what

Hugo wrote:

Not sure what that has to do with the original statement? thought it was to do with whether line-height took a length value :shrug:

One, or both of us, is confused. Leading (line-height) is a vertical measurement that has nothing to do with length-- other than the tradition in typography, when perhaps the wider the line measure the greater the need to adjust leading (line-height) for the sake of making that content easy to read.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

apologies arginine but your

apologies arginine but your thread has been slightly hijacked albeit still on the original topic Smile as a rule of thumb specify your line-height as a 'number' e.g '1.3'
or '1' rather than set a definite unit on it such as px

David 'length' is how px, %, em, pt, pc, mm, cm are referred to. and all these lengths are allowed for on line-height.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

Hugo wrote: David 'length'

Hugo wrote:

David 'length' is how px, %, em, pt, pc, mm, cm are referred to. and all these lengths are allowed for on line-height.

Of course they are all allowed according to the specs. What some designers fail to take into account is that px line-height "trips" IE and Opera; and, as important, that %, em, pt, pc, mm, cm are all less consistent for line-height cross-browser than a unit-less raw number for setting normal content on the screen.

PS Clarification of opinion, yes-- arguing, no.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

David that's all beside the

David that's all beside the point, the issue was not how any particular browser handled something, but whether length units were allowed.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

Hugo wrote:David that's all

Hugo wrote:

David that's all beside the point...

Major Tom
Take your protein pill, put your helmet on...
Ground Control, Huston

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Afraid I don't understand

Afraid I don't understand cryptic comments , something to do with too little time, too much to do, and I'm wasting too much of it on this, so lets call it a day David Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me