Connecting Tech Pros Worldwide Forums | Help | Site Map

Mac and CSS Line Spacing Issues

PinkBishop
Guest
 
Posts: n/a
#1: Jul 20 '05

I have included my .css script below.

This is my first attempt at CSS.

The pages look fine through they eyes of PC browsers and NS on the
Mac.

On IE and Safari for Mac all hell breaks loose.

I am getting huge amounts of white space between lines probably
comparable to about 5-10 line breaks.

Can anybody see a problem with the below script that could be causing
this?

I have removed the reference to the .css and the problem goes away,
but I then do not have styles included.

Thanks,

Tom






..bodytext {
font-family: Verdana, Helvetica, sans-serif;
font-size: 13px;
font-style: normal;
font-weight: normal;
line-height: 20 px;
color: #000000;
background: #98C3C0;
}


..subnavLeft {
font-family: Verdana, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #FFFFFF;
background: #1F5329;
}

..subnavBottom {
font-family: Verdana, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
line-height: 20 px;
color: #1F5329;
}

..cabinRatesTable {
font-family: Verdana, Helvetica, sans-serif;
font-size: 15px;
font-style: normal;
font-weight: normal;
font-weight: bold;
color: #000000;
}

..cabinMenu {
font-family: Verdana, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #000000;
background-color: #84C1DF;
border: 1px #000000 solid;
}

a:active {
text-decoration: none;
color: #FFFFFF;
font-weight: bold;
}

a:link {
text-decoration: none;
color: #FFFFFF;
font-weight: bold;
}
a:visited {
text-decoration: none;
color: #A386B9;
font-weight: bold;
}
a:hover {
text-decoration: underline;
color: #E29F1C;
}
..bodytextbold {
font-family: Verdana, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: 16px;
font-weight: bold;
color: #333333;
}

..h1 { font-family: Verdana, Helvetica, sans-serif;
font-size: 14pt;
color: #4F8884;
font-weight:bold;
}

..h2 { font-family: Verdana, Helvetica, sans-serif;
font-size: 12pt;
color: #1F5329;
font-weight:bold;
}

..h3 { font-family: Verdana, Helvetica, sans-serif;
font-size: 11pt;
color: #1F5329;
font-weight:bold;
}

Neal
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Mac and CSS Line Spacing Issues


On Fri, 05 Mar 2004 00:22:08 -0500, PinkBishop <pinkbishop@hotmail.com>
wrote:
[color=blue]
>
> I have included my .css script below.
>
> This is my first attempt at CSS.
>
> The pages look fine through they eyes of PC browsers and NS on the
> Mac.
>
> On IE and Safari for Mac all hell breaks loose.
>
> I am getting huge amounts of white space between lines probably
> comparable to about 5-10 line breaks.[/color]

Let's see if we can find it, and what else we find along the way, shall we?
[color=blue]
> .bodytext {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 13px;
> font-style: normal;
> font-weight: normal;
> line-height: 20 px;
> color: #000000;
> background: #98C3C0;
> }[/color]

1) If you size Verdana to look good, it being replaced by Helvetica will
result in tiny text. Not the best choice. Arial and Helvetica match up
pretty well. I'd advise NOT using Verdana unless it's going to be at large
sizes anyway, where replacement won't result in inability to read the text.

2) px is an absolute measurement. If my monitor is set for 600X400, then I
reset it for 1024x768, px-sized trext will become half the size. Best
choice is to use % based on the user's preferred default - and going lower
than 90% is risking illegibility. Same with line height. And that's
probably the source of your immediate problem - pixels vary in size from
monitor to monitor. Really, totally ABANDON the notion that anything but %
and maybe ems are useful for sizing fonts, and do murder the person who
told you otherwise.

3) Good for you, setting color and background-color simultaneously.
[color=blue]
> .subnavLeft {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 12px;
> font-style: normal;
> font-weight: bold;
> color: #FFFFFF;
> background: #1F5329;
> }[/color]

1) Verdana issue again.

2) px issue again.

3) Good for you again.
[color=blue]
> .subnavBottom {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 12px;
> font-style: normal;
> font-weight: normal;
> line-height: 20 px;
> color: #1F5329;
> }[/color]

Same, same, same.
[color=blue]
> .cabinRatesTable {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 15px;
> font-style: normal;
> font-weight: normal;
> font-weight: bold;
> color: #000000;
> }[/color]

Specify that background-color just in case.
[color=blue]
> .cabinMenu {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 11px;
> font-style: normal;
> font-weight: normal;
> color: #000000;
> background-color: #84C1DF;
> border: 1px #000000 solid;
> }[/color]
[color=blue]
> a:active {
> text-decoration: none;
> color: #FFFFFF;
> font-weight: bold;
> }
>
> a:link {
> text-decoration: none;
> color: #FFFFFF;
> font-weight: bold;
> }
> a:visited {
> text-decoration: none;
> color: #A386B9;
> font-weight: bold;
> }
> a:hover {
> text-decoration: underline;
> color: #E29F1C;
> }[/color]

If the links are only clear when hovered, how will anyone know to hover?
The color? What if it's a b/w monitor or a colorblind person? Keep the
underlines or at least do something to cue the user in besidfes color.
[color=blue]
> .bodytextbold {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 12px;
> font-style: normal;
> line-height: 16px;
> font-weight: bold;
> color: #333333;
> }[/color]

You know what I'm going to say...
[color=blue]
> .h1 { font-family: Verdana, Helvetica, sans-serif;
> font-size: 14pt;
> color: #4F8884;
> font-weight:bold;
> }[/color]

You know, I should tell you, if you set the font-family for body, all the
elements will inherit it. No need to repeat this like you have. It's
redundant.
[color=blue]
> .h2 { font-family: Verdana, Helvetica, sans-serif;
> font-size: 12pt;
> color: #1F5329;
> font-weight:bold;
> }
>
> .h3 { font-family: Verdana, Helvetica, sans-serif;
> font-size: 11pt;
> color: #1F5329;
> font-weight:bold;
> }[/color]

Same same same.

Whenever you state color, state background color - you never know when a
user style sheet will have something which will too closely match the
color in the background.

Just a few basic tweaks, and this'll pass muster.
Andrew Graham
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Mac and CSS Line Spacing Issues


PinkBishop wrote:[color=blue]
> The pages look fine through they eyes of PC browsers and NS on the
> Mac.
>
> On IE and Safari for Mac all hell breaks loose.
>
> I am getting huge amounts of white space between lines probably
> comparable to about 5-10 line breaks.
>
> Can anybody see a problem with the below script that could be causing
> this?
>
> .bodytext {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 13px;
> font-style: normal;
> font-weight: normal;
> line-height: 20 px;[/color]

Get rid of the space between "20" and "px". A validator, or even a
syntax-highlighting editor should pick up that error.

Andrew Graham



Alan J. Flavell
Guest
 
Posts: n/a
#4: Jul 20 '05

re: Mac and CSS Line Spacing Issues


On Fri, 5 Mar 2004, Andrew Graham wrote:
[color=blue]
> PinkBishop wrote:[color=green]
> >
> > Can anybody see a problem with the below script that could be causing
> > this?
> >
> > .bodytext {
> > font-family: Verdana, Helvetica, sans-serif;[/color][/color]

ahem, someone seems to have reading difficulties... please try to
get tuned to the group's wavelength before trying to take advantage of
its assistance, OK? As the traditional usenauts used to say, "lurk
before you leap".
[color=blue][color=green]
> > font-size: 13px;
> > font-style: normal;
> > font-weight: normal;
> > line-height: 20 px;[/color]
>
> Get rid of the space between "20" and "px".[/color]

Sure; but that's not all that's wrong with the above. Consider a user
who, for whatever reason, has told their browser to set a min font
size of say 28px. That line height isn't going to be very useful.

That would be fine if designing for the author's own printout,
but in a WWW context it needs a significantly more flexible approach.
I'd suggest working mostly in em units (and/or percentage).
[color=blue]
> A validator, or even a
> syntax-highlighting editor should pick up that error.[/color]

Certainly the questioner should use appropriate software, such as a
CSS syntax checker, before appealing to the liveware on usenet. But
syntactical correctness by itself is not enough.

all the best
Jim Royal
Guest
 
Posts: n/a
#5: Jul 20 '05

re: Mac and CSS Line Spacing Issues


In article <8j3g4058b2334kidli3m1hu3ju6vslo6sm@4ax.com>, PinkBishop
<pinkbishop@hotmail.com> wrote:
[color=blue]
> The pages look fine through they eyes of PC browsers and NS on the
> Mac.
>
> On IE and Safari for Mac all hell breaks loose.
>
> I am getting huge amounts of white space between lines probably
> comparable to about 5-10 line breaks.[/color]

The problem is indeed the space between the 20 and the px. Fix that,
and all is better.

A tip to save you some work:

I notice you are using class names such as .bodytext .h1 and .h2 and
..h3. This requires markup such as:

<p class="bodytext">
<p class="h1">
<p class="h2">
<p class="h3">

Why not simple style the HTML elements directly? You can then replace
the above markup with:

<p>
<h1>
<h2>
<h3>

--
Jim Royal
"Understanding is a three-edged sword"
http://JimRoyal.com
Karl Smith
Guest
 
Posts: n/a
#6: Jul 20 '05

re: Mac and CSS Line Spacing Issues


PinkBishop <pinkbishop@hotmail.com> wrote:
[color=blue]
> I have included my .css script below.[/color]

<grr>Script!? Did you say, "Script"!?</grr>
[color=blue]
> I am getting huge amounts of white space between lines probably
> comparable to about 5-10 line breaks.
>
> Can anybody see a problem with the below script that could be causing
> this?
>
> .bodytext {
> font-family: Verdana, Helvetica, sans-serif;
> font-size: 13px;
> line-height: 20 px;[/color]

Line height is just a number, it doesn't need units. 13/20 would be
about:

line-height: 1.5;

Now you can do it the hard way, and include units, like this:

line-height: 20px;

But definitely *not* like this:

line-height: 20 px;

And don't believe any CIWAHian trolling about Verdana (unless you want
to). But, do believe anyone who says not to set font-size in pixels.
And do send hate mail to Jonathan Frakes.

--
Karl Smith.
Alan J. Flavell
Guest
 
Posts: n/a
#7: Jul 20 '05

re: Mac and CSS Line Spacing Issues


On Sat, 5 Mar 2004, Karl Smith wrote:
[color=blue]
> And don't believe any CIWAHian trolling about Verdana[/color]

Feel free to present the facts. If you don't, people might suspect
you had nothing better than resorting to name-calling.
Nick Theodorakis
Guest
 
Posts: n/a
#8: Jul 20 '05

re: Mac and CSS Line Spacing Issues


On Sat, 6 Mar 2004 01:00:24 +0000, "Alan J. Flavell"
<flavell@ph.gla.ac.uk> wrote:
[color=blue]
>On Sat, 5 Mar 2004, Karl Smith wrote:
>[color=green]
>> And don't believe any CIWAHian trolling about Verdana[/color]
>
>Feel free to present the facts. If you don't, people might suspect
>you had nothing better than resorting to name-calling.[/color]

There seems to me to be at least two issues.

One the one hand, there is the unfortunately too-common practice of
suggesting a small font size for main text, then "rescuing" its
legibility by also suggesting Verdana, in which case the text may be
unreadable if Verdana is not available to the user.

On the other hand, there is also the belief that Verdana is too "big
looking" or otherwise unappealing at 1em. Although I happen to think
it may look a little odd in such cases (although I wouldn't go so far
to say it's ugly), surely there can be room here to account for
personal taste?

On the gripping hand, at larger sizes (such as the typical browser
defaults for <h2>), I actually think that Verdana looks pretty decent.
So perhaps a case can me made for suggesting Verdana when the text is
likely to be large (e.g., headings) or small (<sup>?) but not
in-between.

I think there also might be a case for not suggesting Helvetica, at
least for a first choice. Although it is a beautiful font when done
properly (if you like sans-serif fonts), some common browers (let the
reader understand!) make an absolute mess of it. I also notice that my
copy of Mozilla (1.4 on Win98) doesn't even try to render it; it
sneakily slips Arial in its place, even though I have Helvetica
installed.

Nick

--
Nick Theodorakis
nick_theodorakis@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
Karl Smith
Guest
 
Posts: n/a
#9: Jul 20 '05

re: Mac and CSS Line Spacing Issues


nick_theodorakis@hotmail.com (Nick Theodorakis) wrote:
[color=blue]
> One the one hand, there is the unfortunately too-common practice of
> suggesting a small font size for main text, then "rescuing" its
> legibility by also suggesting Verdana, in which case the text may be
> unreadable if Verdana is not available to the user.[/color]

U-huh. In which case the blame should be assigned correctly. To an
author's pathological desire to use the smallest text possible, not to
any alleged shortcomings of the Verdana font.

[color=blue]
> On the other hand, there is also the belief that Verdana is too "big
> looking" or otherwise unappealing at 1em. Although I happen to think
> it may look a little odd in such cases (although I wouldn't go so far
> to say it's ugly), surely there can be room here to account for
> personal taste?[/color]

U-huh. But there is no room for personal taste in the CIWAHian world.
Everyone must conform, in every way, every time.

[color=blue]
> On the gripping hand, at larger sizes (such as the typical browser
> defaults for <h2>), I actually think that Verdana looks pretty decent.
> So perhaps a case can me made for suggesting Verdana when the text is
> likely to be large (e.g., headings) or small (<sup>?) but not
> in-between.[/color]

Something both I and Lauri R. have previously said. I can't speak for
Lauri, but I still like Verdana for headings.

[color=blue]
> I think there also might be a case for not suggesting Helvetica, at
> least for a first choice. Although it is a beautiful font when done
> properly (if you like sans-serif fonts), some common browers (let the
> reader understand!) make an absolute mess of it. I also notice that my
> copy of Mozilla (1.4 on Win98) doesn't even try to render it; it
> sneakily slips Arial in its place, even though I have Helvetica
> installed.[/color]

[How do you tell the difference between real Helvetica and Arial?]

The real issue is what does the author hope to achieve in setting a
typeface at all? Is there actually any goal in mind, or is it merely
habit?

I think the constant stream of warnings about Verdana are just a
habit. What's its crime - being widely spaced? So what? Web pages
aren't books, we're constantly being hounded - put aside your
prejudices. If you print a book in a wide font it will literally cost
you more because you'll get fewer words per page and need more pages.
Web pages are as long as they are. The cost doesn't change with
typographical choices.

Now back to authors - if the desire is to use small sizes on screen
(why!?), specify high ex-height fonts. Something like:

"Georgia, Verdana, Tahoma"

"What? One is seriffed and others sans-serif!" says Mr Newbie.

So what? Eh, so what? OTOH, If the desire is merely to give a list of
commonly installed sans-serif fonts, Verdana is possibly
inappropriate. It seems to stand out as different in the commonly seen
"Verdana, Arial, Helvetica, sans-serif". But then if you're just
listing commonly installed sans-serif fonts, for no particular
purpose, you're definitely on Team Clueless.

--
Karl Smith.
Nick Theodorakis
Guest
 
Posts: n/a
#10: Jul 20 '05

re: Mac and CSS Line Spacing Issues


On 6 Mar 2004 00:41:45 -0800, google-2003-03@kjsmith.com (Karl Smith)
wrote:

[...]
[color=blue]
>[How do you tell the difference between real Helvetica and Arial?]
>[/color]

See:

<http://www.ms-studio.com/articlesarialsid.html>

for example.


Nick

--
Nick Theodorakis
nick_theodorakis@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
Closed Thread


Similar HTML / CSS bytes