HighDots Forums  

CSS line spacing

alt.html alt.html


Discuss CSS line spacing in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Smithz
 
Posts: n/a

Default CSS line spacing - 03-02-2006 , 01:40 PM






Hi there,

I was asked to make a paragraph of text to have 1.5 line spacing on a
website. I noticed (using Dreamweaver) there was a CSS style that allowed me
to set the "Line height" (under the Type category when editing a Style sheet
in Dreamweaver). I set this to 150% (not knowing what some of the other
options were).

Although this had the desired effect in the Dreamweaver screen layout of the
website, when previewing in IE6 or Firefox it did not have the extra line
space.

Anyone know why this is?

Kind regards

Dave



Reply With Quote
  #2  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: CSS line spacing - 03-02-2006 , 02:27 PM






David Smithz wrote:

Quote:
Hi there,

I was asked to make a paragraph of text to have 1.5 line spacing on a
website. I noticed (using Dreamweaver) there was a CSS style that allowed me
to set the "Line height" (under the Type category when editing a Style sheet
in Dreamweaver). I set this to 150% (not knowing what some of the other
options were).

Although this had the desired effect in the Dreamweaver screen layout of the
website, when previewing in IE6 or Firefox it did not have the extra line
space.

Anyone know why this is?
In stylesheet for desired element, class, or id:

line-height: 1.5em;
or
line-height: 150%;

should do it, not sure how DW's widget interface implements it though.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #3  
Old   
David Smithz
 
Posts: n/a

Default Re: CSS line spacing - 03-03-2006 , 06:23 AM



Finally worked out why it was not working for me.

I had the style name beginning with a number! Therefore I had called the
style
..1-5-linespacing.

When I put a letter at the start it worked. I'm suprised Dreamweaver did not
warn me about this, but all is well now.

Thanks for your help.



Reply With Quote
  #4  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: CSS line spacing - 03-03-2006 , 09:05 AM



David Smithz wrote:
Quote:
Finally worked out why it was not working for me.

I had the style name beginning with a number! Therefore I had called the
style
.1-5-linespacing.

When I put a letter at the start it worked. I'm suprised Dreamweaver did not
warn me about this, but all is well now.
I am afraid nothing can substitute for knowing the spec.

http://www.w3.org/TR/CSS21/cover.html

DW as with any of WYSIWYG editors are really not good for the novices,
they keep you blissfully ignorant of the rules and promote bad habits
and poor markup (but they can do it really fast and easy!). They can
become a crutch. They can be a useful tool in skilled hands, personally
I prefer to hand code. I advise one to master hand-coding, learn to do
it correctly, then if you wish use a WYSIWYG editor.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #5  
Old   
David Smithz
 
Posts: n/a

Default Re: CSS line spacing - 03-03-2006 , 03:26 PM




"Jonathan N. Little" <lws4art (AT) centralva (DOT) net> wrote in message
Quote:
I am afraid nothing can substitute for knowing the spec.

http://www.w3.org/TR/CSS21/cover.html

DW as with any of WYSIWYG editors are really not good for the novices,
they keep you blissfully ignorant of the rules and promote bad habits and
poor markup (but they can do it really fast and easy!). They can become a
crutch. They can be a useful tool in skilled hands, personally I prefer to
hand code. I advise one to master hand-coding, learn to do it correctly,
then if you wish use a WYSIWYG editor.
I would love to know all this stuff inside, but I guess it's a trade off of
how much time one has to how much one will be using it.

Just out of interest, is the CSS 2 standard currently supported but the
latest browsers. So if I do invest the time reading this and learning it,
can I apply what I learn right now? (therefore does IE6 and firefox support
this).

I wish I had more time to read all the things I wanted to learn about.

Cheers for your input.




Reply With Quote
  #6  
Old   
Chris Beall
 
Posts: n/a

Default Re: CSS line spacing - 03-03-2006 , 04:11 PM



David Smithz wrote:

Quote:
"Jonathan N. Little" <lws4art (AT) centralva (DOT) net> wrote in message

I am afraid nothing can substitute for knowing the spec.

http://www.w3.org/TR/CSS21/cover.html

DW as with any of WYSIWYG editors are really not good for the novices,
they keep you blissfully ignorant of the rules and promote bad habits and
poor markup (but they can do it really fast and easy!). They can become a
crutch. They can be a useful tool in skilled hands, personally I prefer to
hand code. I advise one to master hand-coding, learn to do it correctly,
then if you wish use a WYSIWYG editor.


I would love to know all this stuff inside, but I guess it's a trade off of
how much time one has to how much one will be using it.

Just out of interest, is the CSS 2 standard currently supported but the
latest browsers. So if I do invest the time reading this and learning it,
can I apply what I learn right now? (therefore does IE6 and firefox support
this).

I wish I had more time to read all the things I wanted to learn about.

Cheers for your input.


David,

Support varies, but I would rate Firefox and Opera and Safari as good,
with IE 6 as fair, provided you use an HTML Strict DOCTYPE. There are
some parts of the spec that nobody seems to support. Don't fall in love
with a concept until you've tried it out. Example: the :hover
pseudo-class is defined for all elements, but IE 6 supports it only for
links. In some cases (not this one), there are easy workarounds.

Yes, if you learn CSS 2.1, you can apply it now. Just not ALL of it...

Chris Beall



Reply With Quote
  #7  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: CSS line spacing - 03-05-2006 , 03:48 PM



"Jonathan N. Little" <lws4art (AT) centralva (DOT) net> wrote:

Quote:
line-height: 1.5em;
or
line-height: 150%;
line-height: 1.5
is possible, too, and actually works better when you have font size
variation inside the block. This is a long story, and I won't go into
details here, but read about line-height in a good book on CSS.

(You will probably also realize that you need to tell the person who
asked for 1.5 spacing that he doesn't understand the issue. There might
be special cases where 1.5 is OK, but for the most of it, it is too
much.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html




Reply With Quote
  #8  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: CSS line spacing - 03-05-2006 , 05:47 PM



Jukka K. Korpela wrote:
Quote:
"Jonathan N. Little" <lws4art (AT) centralva (DOT) net> wrote:


line-height: 1.5em;
or
line-height: 150%;


line-height: 1.5
is possible, too,
Yes I am aware this in one of the few unit-less values for a CSS
property, I guess basically a ratio value. I chose not to because so
many newbe's 'forget' the units in other CSS properties where it is
required that I did not want to confuse the issue.

Quote:
and actually works better when you have font size
variation inside the block. This is a long story, and I won't go into
details here, but read about line-height in a good book on CSS.
Any online source where this advantage is discussed?

Quote:
(You will probably also realize that you need to tell the person who
asked for 1.5 spacing that he doesn't understand the issue. There might
be special cases where 1.5 is OK, but for the most of it, it is too
much.)

I can have a the effect of 'lightening' your text blocks and giving a
softer feel to your page with a plain old san-serif font without
resorting to an obscure face like Bernard Fashion than many folks would
not have. But yes I agree with you.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.