Why don't it work?

J

Jukka K. Korpela

Lewis said:
Really? Don't you have to specify a unit?

We don't (and normally shouldn't).
Or does 1.3 get translated to 130%?

No, a plain number like 1.3 has a specific meaning when used as the value of
line-height, as described in CSS recommendations. The main reason for
preferring a plain number there is that when line-height value is inherited,
it is the computed value that will be inherited, by definition. You don't
want that to be the calculated value of 130%, since that might be unsuitable
for inner elements that have a different font size; you want it to be the
value 1.3, which is inherited as such and then used as relating to each
element's own font size.
 
D

dorayme

Lewis said:
Really? Don't you have to specify a unit?

Or does 1.3 get translated to 130%?

It is almost always better not to supply units. Using a number
gets you a proportion of the font size. There might be special
cases where using units is what you want, but you need to be
aware of the consequences. Simple rule for most purposes: Don't
use units.

It works like this, no unit and the line-height gets to be a
proportion (yes, I guess a percentage) and, crucially, this gets
to be for all text that is in the element you declare it on *and*
in its descendent elements. That is usually fine. Because?
Because then, if the text is a different size (as set by the
author or by default) in the descendant elements, they will get
that proportion of the particular size and it should look natural
enough if the line height set for the original ancestor looks
natural enough.

If you use units, you can get a weird result in 'descendant'
text. This latter text, no matter how big or how small, will get
a line-height appropriate to the text in the original ancestor
but almost certainly inappropriate for text of a different size.
Imagine the result in the browser is roughly three pixels between
the lines of text in the ancestor. For text that looks fine with
this gap.

Now imagine how bad this will look for really big text in a
descendant - yes, it will get the three pixels! Specifying units
is a poisoned bequest in that it sets in stone gaps that are only
appropriate to the ancestor.

I have something on this that illustrates the issue that you may
find useful if the above is too obscure.

<http://dorayme.netweaver.com.au/alt/line-height_demo.html>
 
P

P E Schoen

"Evan Platt" wrote in message
But never in the books. bullis was mis-quoting a quote that
never existed in the first place. And I guarantee you, bullis
has never seen the movies you mentioned.
He states incorrect facts (he's stated "Like PT Barnum once
said, there's a sucker born every minute") or, he totally
butchers a actual quote.

Here's what snopes has to say:
http://www.snopes.com/quotes/signature/elementary.asp

And I guess I (un)learned something today!

Paul
 
P

P E Schoen

"Lewis" wrote in message
Really? Don't you have to specify a unit?
Or does 1.3 get translated to 130%?

I was unable to use that for the Google site (because it was "unsafe"), but
I tried it on another website builder that I'm evaluating and it seems to
work. I wrapped the entire flyer with <DIV style="line-spacing: 1.3"> ....
</div>

Actually, that was wrong, although it appeared to work. This gives better
results: <DIV style="line-height: 1.3;"> ... </div>

Here is the result:
http://www.bgf.doodlekit.com/home/monthly_meeting_flyer

I don't know why the content looked OK in the email but then showed the text
overlapped in the website page. Also strange was that the editor still
showed the text overlapped, but the actual page was OK with the line spacing
adjustment. But that was because I had used "line-spacing". Here is more
info:
http://webdesign.about.com/od/styleproperties/qt/css_line_spacing.htm

This website tool seems much better than the Google "product".

Paul
 
D

Denis McMahon


There's a secret php file that gets globally included from the php
developers website whenever any other php file is run on a webserver.

It has the following contents:

<?php
if (strstr($_SERVER['HOST_NAME'],"1littleworld.net")) die ("because you
are richard");
?>

This is why your php does not work, it is also why php can never work
for you, and you should go learn aspx and bug the shit out of the
microsoft groups instead.

Rgds

Denis McMahon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
BrentonMcc
Top