472,146 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Why does stylesheet directive not work with FireFox?

Firefox will not take the following "font-weight:bold" directive in my
stylesheet. Works fine in IE.

#rightMenuText h5 {
font-weight:bold;
padding-bottom:0px;
padding-top: 10px;
margin-bottom:0px;
}

If you view http://www.clearpointsystems.com in both FF and IE you can see
difference. I've been trying different things, but can't seem to get the
bold font. Is there something wrong with my code? Or is this another quirk
with FF vs. IE?

Here's the (abbreviated) code:

<div id="rightMenu">
<div id="rightMenuBody">
<div id="rightMenuText">
<p>[image]</p>
<h5>Welcome to CSI</h5>
[text]
<h5>Big News!</h5>
[text]
<h5>Security Matters</h5>
[text]
<h5>[more headings]</h5>
[more text]
Jul 21 '05 #1
19 9174
> Firefox will not take the following "font-weight:bold" directive in my
stylesheet. Works fine in IE.


I figured it out - I was redefining the <h5> tag in the stylesheet. IE
still rendered it as an h5, but not FF. So it appeared "bold" in IE, but
only as regular text in FF. The different browsers were rendering the exact
same code differently - ah yes, the joy of web programming.
Jul 21 '05 #2
deko wrote:
Firefox will not take the following "font-weight:bold" directive in my
stylesheet. Works fine in IE.
It renders it here - XP with FF 1.0.

However it does still look very different to IE's version. Both are
bold, but in FF the heading text is approximately 60% of the size of the
text it heads, hence the bold effect is visually almost lost.

There's something daft going on with font sizes, nothing more.

TBH I'd expect FF's behaviour. The div containing the heading has a
font-size of 10px, so h5 would default to about 6px & I didn't notice
you explicitly setting a font size elsewhere that would affect h5.

That IE does its own thing doesn't surprise me - it's clearly decided
your decision is a <polite>silly</polite> one & it knows better.

More oddly, Opera 8 does something similar to IE - though if I use the
web developer toolbar (http://nontroppo.org/wiki/WebDevToolbar) to tell
me the computed styles for h5 it reports 6px which certainly isn't how
it renders it. I'd guess they don't necessarily reflect the final
decisions used in rendering :-/

#rightMenuText h5 {
font-weight:bold;
padding-bottom:0px;
padding-top: 10px;
margin-bottom:0px;
}

If you view http://www.clearpointsystems.com in both FF and IE you can see
difference. I've been trying different things, but can't seem to get the
bold font. Is there something wrong with my code? Or is this another quirk
with FF vs. IE?

Here's the (abbreviated) code:

<div id="rightMenu">
<div id="rightMenuBody">
<div id="rightMenuText">
<p>[image]</p>
<h5>Welcome to CSI</h5>
[text]
<h5>Big News!</h5>
[text]
<h5>Security Matters</h5>
[text]
<h5>[more headings]</h5>
[more text]


In any case, why are you using a level five heading at that point? What
happened to h1 to h4? I'd expect these to be nested before a recourse to h5.

Oh, someone else will probably add font sizes in px are bad(tm) - better
to use ems or percentages aiui.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 21 '05 #3
On Thu, 17 Mar 2005, deko wrote:
Firefox will not take the following "font-weight:bold" directive in my
stylesheet. Works fine in IE.

#rightMenuText h5 {
font-weight:bold;
padding-bottom:0px;
padding-top: 10px;
margin-bottom:0px;
}

If you view http://www.clearpointsystems.com in both FF and IE you
can see difference.
#rightMenuText has idiotically specified a font size of 10px, and
it seems to me that Moz has done just what was asked.

If I look at 10px Arial in normal and bold weight in Mozilla or FF,
they look almost same, because they're too tiny to be able to discern
much difference. They don't need to be embedded deep in some complex
structure of divs to see this.

If I would set them a sensible size (I used 1em in my comparison
test), there's a clear difference between normal and bold.
with FF vs. IE?


Can you explain IE's logic in determining the size of this text?
Maybe I'm missing something.
Jul 21 '05 #4
> It renders it here - XP with FF 1.0.

I've been making various changes since my post - that may account for the
varying results at this point.
That IE does its own thing doesn't surprise me - it's clearly decided
your decision is a <polite>silly</polite> one & it knows better.
I'm sure my code is not the best - I just wish I got consistent results.
More oddly, Opera 8 does something similar to IE - though if I use the
web developer toolbar (http://nontroppo.org/wiki/WebDevToolbar) to tell
me the computed styles for h5 it reports 6px which certainly isn't how
it renders it. I'd guess they don't necessarily reflect the final
decisions used in rendering :-/ In any case, why are you using a level five heading at that point? What
happened to h1 to h4? I'd expect these to be nested before a recourse to h5.

I thought I might use those other <h> tags somewhere else, so I picked one
that I thought I would not use. Does it matter what it is if I redefine it?
Oh, someone else will probably add font sizes in px are bad(tm) - better
to use ems or percentages aiui.


I thought it was better to us px. That's news to me if it's bad(tm). Why?

Thanks for the reply!
Jul 21 '05 #5
> Can you explain IE's logic in determining the size of this text?

Logic? I'd say it a "feature"

There's another feature of IE I'd like to figure out. I generate that left
nav bar with the below PHP code. The problem is the vertical spacing of the
links is different in IE than it is in FF. Is there a way to get consistent
spacing? Why are the <p> tags rendered differently by IE than they are in
FF?

<?php
function linkcolor($arg)
{
$nav = trim($_GET[nav]);
if ( $arg == $nav )
{ return "grnlink";}
else
{ return "blulink";}
}
echo "

<p><span class=".linkcolor('Home Page').">
<a href='index.php?nav=Home Page'>Home Page</a>
</span></p>

<p><span class=".linkcolor('Contact').">
<a href='contact.php?nav=Contact'>Contact</a>
</span></p>

<p><span class=".linkcolor('Services').">
<a href='services.php?nav=Services'>Professional Services
</a></span></p>

";
?>
Jul 21 '05 #6
> I thought it was better to us px. That's news to me if it's bad(tm).
Why?

This explains it well -
http://www.xs4all.nl/~sbpoley/webmatters/fontsize.html

But with all the various "features" in all the various browsers, authors
don't want the presentation of their pages getting screwed up. Thus px is
more reliable for consistent presentation. Complaints should be sent to the
browser makers. When my code looks the same in all the different browsers,
I will stop using px. And as far as I can see (pun intended) the only
reason *not* to use px is to allow people to change the font size. Well, I
try to use fonts that are large enough for everyone to read anyway. And, if
necessary, one can always adjust his monitor resolution.
Jul 21 '05 #7
deko <de**@hotmail.com> wrote:
This explains it well -
http://www.xs4all.nl/~sbpoley/webmatters/fontsize.html

But with all the various "features" in all the various browsers,
Like minimum font size? Or the ability to ignore document font sizes? Or
user style sheets that enforce min-width or max-width? Or Opera's new
Fit-to-Window feature?
authors don't want the presentation of their pages getting screwed up.
Thus px is more reliable for consistent presentation. Complaints should
be sent to the browser makers. When my code looks the same in all the
different browsers, I will stop using px.
Your markup is never going to look the same in all the different browsers.
That's the reality of the WWW. Using px for font sizes isn't going to
change that; it just causes your page to break for some potential readers.
And if your layout relies on your px-based font sizes, then your page can
break in even more ways when they are ignored.

See also http://www.westciv.com/style_master/...oil/not_paper/
And as far as I can see (pun intended) the only reason *not* to use px is
to allow people to change the font size. Well, I try to use fonts that
are large enough for everyone to read anyway.


So how large is "large enough for everyone to read"?

I know people who can't read fonts that I find comfortable to read. And I
find it awkward and inconvenient to read the "large print" fonts that they
need. If you leave the font size alone (using 1em or 100% for normal text),
then we can all be happy. If you use px, then someone is guaranteed to be
inconvenienced.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"I'd love to make time, if only I could find the recipe."
Jul 21 '05 #8
deko wrote:
There's another feature of IE I'd like to figure out. I generate that
left nav bar with the below PHP code. The problem is the vertical spacing
of the links is different in IE than it is in FF.
Browsers are different.

Different browsers have different defaults.

You are probably experiencing variations in margins and/or padding.
Is there a way to get consistent spacing?
Try specifying the above in your style sheet.

<?php
function linkcolor($arg)
{
$nav = trim($_GET[nav]);
if ( $arg == $nav )
{ return "grnlink";}
else
{ return "blulink";}
}


This code isn't very readable, it took me a while before I noticed that you
aren't prefixing your class names with full stops, but it was PHP syntax.

Try this:

?>
<p><span class="<?php echo linkcolor('Home Page') ?>">
<a href='index.php?nav=Home Page'>Home Page</a>
</span></p>

<!-- more links -->
....
<?php

And I'd suggest you change your markup too. A list of links shouldn't really
be marked up as a series of paragraphs. Try using a list instead.

http://css.maxdesign.com.au/listamatic/

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 21 '05 #9
On Thu, 17 Mar 2005, deko wrote:
authors don't want the presentation of their pages getting screwed
up.
Then they'd do better to ask for what the reader needs, instead of
relying on the reader to override whenever the author's demands are
inappropriatate.
Thus px is more reliable for consistent presentation.
This is complete nonsense, I'm afraid. The only thing "consistent"
about authors who specify px font sizes for my 135dpi desktop display
is that I yell "aaargh microfonts" and either leave, or reach for the
override.

Even *if* browsers implemented the CSS px unit to specification (which
in practice they generally don't), it would still make no allowances
for individual needs. CSS px units, implemented to spec, might be
appropriate for a collective viewing situation (projector, for
example) where everyone is forced to view the display at the "same
size", but for personal viewing the only reliable unit is the reader's
chosen normal text size.
When my code looks the same in all the different browsers,
"Looks the same" on Lynx, mobile phone, theatre projector,
IBM HPR? You're missing the point of the WWW.
I will stop using px.


You *will* "stop using px" whenever I need to read your page, no
matter what you put into your stylesheet. The harder you try to do
the wrong thing, the greater the probability that the reader will have
to out-vote you. And on the WWW the reader always gets the last word.

Jul 21 '05 #10
deko wrote:
I wrote:
In any case, why are you using a level five heading at that point?
What happened to h1 to h4? I'd expect these to be nested before a
recourse to h5.
I thought I might use those other <h> tags somewhere else, so I
picked one that I thought I would not use. Does it matter what it is
if I redefine it?


Not in terms of how it will appear in a browser following your styles,
however... firstly, some won't; secondly, html is much easier to
interpret if the available elements are used to mark up your content's
structure as appropriately as possible & hence are used to convey as
much information about the document structure as possible.

If when you need an h<x> you arbitrarily choose the <x>, you lose the
chance to use that number to tell the reader something specific /about/
the heading required at that point.

By sticking to having a single h1 per page & thereafter ensuring h2 to
h6 are nested in that order, the h<x> at any point now reflects the
degree of subdivision of a document, iyswim?

eg

h1
h2
h2
h3
h4
h3
h4
h2
I thought it was better to us px. That's news to me if it's bad(tm).
Why?


I see others have commented on this ;)

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 21 '05 #11
> You *will* "stop using px" whenever I need to read your page, no
matter what you put into your stylesheet. The harder you try to do
the wrong thing, the greater the probability that the reader will have
to out-vote you. And on the WWW the reader always gets the last word.


This whole argument hinges on one question: Should users be allowed to
adjust the font size in a web page? As long as you don't make things too
small, I don't think its an issue. Folks with poor eyesight will probably
have a monitor resolution setting that accommodates their needs anyway,
without having to adjust font sizes in web pages.

Still, what you've not so eloquently argued is that, yes, people should be
able to adjust the font size in a web page. But you also seem to be saying
that you *will* override my settings if use px. So what difference does it
make? Is it harder for you to adjust the font size when I use px?

I looked for alternate font sizes recently as I was authoring another page.
The code completion feature in Dreamweaver - when coding a stylesheet -
lists font-sizes in px-denominated values and also "large" and "small". I
didn't see any other options in the drop-down list. Call me lazy, but I
didn't look for alternate sizes beyond that.

I can't say I've found anything persuasive enough on Stephen Poley site, or
in your rant, to change something that's been working so well for so long.
Jul 21 '05 #12
On Sat, 19 Mar 2005, deko wrote:
This whole argument hinges on one question:
Not at all.
Should users be allowed to adjust the font size in a web page?
In our jurisdictions it's illegal to even /try/ to stop them - even
though the attempt is futile, because, in a WWW context, the user
always has the last word anyway.
As long as you don't make things too small,
The author can have no idea what's "too small" for each reader.
Only the reader knows that. Once you've managed to grasp that idea,
everything else falls into place.
I don't think its an issue.
(oh yes you do, or you wouldn't be arguing on this thread.)
Folks with poor eyesight will probably have a monitor resolution
setting that accommodates their needs anyway,
Eh? When readability is an issue, it's best to set the resolution as
high as the display can naturally accommodate, and zoom the material
to suit.
Still, what you've not so eloquently argued is that, yes, people
should be able to adjust the font size in a web page.
Erm, I've merely pointed out that some people /will/ adjust it if they
need to. That's a fact, not an opinion. My *opinion* is that it's a
good idea to take the facts into account when deciding on one's
authoring style. The flexible style of authoring is the one which
best fits the facts.
But you also seem to be saying
that you *will* override my settings if use px.
My normal browser (Mozilla) configuration (for the 135dpi desktop
settings) - when I'm not being asked to critique a page's design -
sets a minimum font size of 15px, so yes, if you ask for anything less
you won't get it. (On the laptop it's 13px).
So what difference does it make? Is it harder for you to adjust the
font size when I use px?
For me, "no": for the majority of MSIE users, "yes".

I'm just trying to guide you to an understanding that asking for
something that's inappropriate to a proportion of your users - trying
to rely on them overriding it (they aren't all as well-informed about
their browser's capabilities as I am, after all) is quite unnecessary,
when there's a size unit (100% or 1em) that achieves its intended
purpose for all of them.
I can't say I've found anything persuasive enough on Stephen Poley
site, or in your rant, to change something
It's OK: your inflexible approach to this topic has been clear from
the start. My participation here wasn't intended for you, it was for
anyone reading this thread who is willing to consider what they're
really doing.
that's been working so well for so long.


If you say so. Bye.
Jul 21 '05 #13
On Sat, 19 Mar 2005 06:06:55 GMT, "deko" <de**@hotmail.com> wrote:

[Alan J. Flavell wrote...]
You *will* "stop using px" whenever I need to read your page, no
matter what you put into your stylesheet. The harder you try to do
the wrong thing, the greater the probability that the reader will have
to out-vote you. And on the WWW the reader always gets the last word.
This whole argument hinges on one question: Should users be allowed to
adjust the font size in a web page?


Yes of course!

If I invite a guest into _my_ house I have the right to expect the guest
to accept and follow my house rules.

If I invite your web pabe into _my_ browser I have the right to expect
your page to accept and follow my browsers house rules.

In either case the soultion is simple;

[an invited guest | your web page] breaks my house rules?
then expect to be kicked out in the cold.

[...]

--
Rex
Jul 21 '05 #14
> If I invite a guest into _my_ house I have the right to expect the guest
to accept and follow my house rules.

If I invite your web pabe into _my_ browser I have the right to expect
your page to accept and follow my browsers house rules.

In either case the soultion is simple;

[an invited guest | your web page] breaks my house rules?
then expect to be kicked out in the cold.

Jul 21 '05 #15
> >This whole argument hinges on one question: Should users be allowed to
adjust the font size in a web page?


Yes of course!

If I invite a guest into _my_ house I have the right to expect the guest
to accept and follow my house rules.

If I invite your web pabe into _my_ browser I have the right to expect
your page to accept and follow my browsers house rules.

In either case the soultion is simple;

[an invited guest | your web page] breaks my house rules?
then expect to be kicked out in the cold.


I'm not sure that's the best analogy. I don't want my page to be 'invited
into a browser'. I want my audience to be able to read the content and use
the resources available on my page. In this way it's like a book or a
magazine. Not everyone can read regular size print. But most people can.
Of course I want to accommodate as wide an audience as possible, and I think
it's a good idea to have adjustable font sizes, but that's something the
browser should do. From a web programmer's perspective, I want a reliable
standard to code against. I don't want Firefox to render things one way, IE
another, and Opera a third. But that's what we have today and that's why
developers are hanging on to px as a standard. My guess is px will remain a
standard and the folks who make the browsers will learn how to adjust it.
Only time will tell.
Jul 21 '05 #16
deko wrote:
This whole argument hinges on one question: Should users be allowed to
adjust the font size in a web page? As long as you don't make things too
small, I don't think its an issue. Folks with poor eyesight will probably
have a monitor resolution setting that accommodates their needs anyway,
without having to adjust font sizes in web pages.

I can't say I've found anything persuasive enough on Stephen Poley site, or
in your rant, to change something that's been working so well for so long.


Flavell is not ranting. He is giving you good, solid advice. Listen to
him ... and all the others who offer similar advice. Or don't listen to
him, and let your clients wonder why they are losing visitors.

Jul 21 '05 #17
deko wrote:

I'm not sure that's the best analogy. I don't want my page to be 'invited
into a browser'. I want my audience to be able to read the content and use
the resources available on my page. In this way it's like a book or a
magazine. Not everyone can read regular size print. But most people can.
A web page is not a page from a book. Pages in books have fixed sizes,
with fonts of fixed sizes. Web pages are far more flexible: you have
opportunities with web pages that you don't have with books, including
the ability to offer each reader their choice of page and font size.

Another point is that you delude yourself if you think that you can
control font sizes. In the first places, some browsers (e.g. Firefox)
let the user easily resize your text, even if you specify sizes in
pixels. In the second place, 12px on one display is not necessarily the
same size as 12px on another, so what may be just right for you may be
too large for some, and too small for others ... and might badly break
your site.

And why do you harp on the issue that most people can read regular-size
print? So what? Most people in the US are white, but does that mean
that it is okay to disregard those who are not? The web is much more
diverse that you appear to realize.
Of course I want to accommodate as wide an audience as possible, and I think
it's a good idea to have adjustable font sizes, but that's something the
browser should do. From a web programmer's perspective, I want a reliable
standard to code against. I don't want Firefox to render things one way, IE
another, and Opera a third.


Who are you building your sites for? You, or your clients' visitors?
If you are building a site just for yourself, then fine, go ahead and
try to get total control over page appearance. But if you are building
your sites for your clients' visitors, then you have to serve their
needs, not your wants.

Jul 21 '05 #18
deko wrote:
You *will* "stop using px" whenever I need to read your page, no
matter what you put into your stylesheet. The harder you try to do
the wrong thing, the greater the probability that the reader will have
to out-vote you. And on the WWW the reader always gets the last word.

This whole argument hinges on one question: Should users be allowed to
adjust the font size in a web page?


That's like asking if a person reading a book should be allowed to use a
magnifying glass if the print's too small for him to read it without
one, or if he should be allowed to have someone else read the text to
him without also telling him how the text is arranged on the page or
what kinds of borders are used.

As long as you don't make things too small, I don't think its an issue.


Have you never met people who blow text up to characters a centimeter or
larger in order to be able to read them? Have you seen how large the
print is in large-print books published for the visually impaired?
Jul 21 '05 #19
deko wrote:
I don't want my page to be 'invited
into a browser'. I want my audience to be able to read the content and use
the resources available on my page.


They won't if they can't, or if it's more trouble for them than it's
worth. Isn't that obvious?
Jul 21 '05 #20

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Tony Carnell | last post: by
3 posts views Thread by juergen.riemer | last post: by
2 posts views Thread by Jim Carr | last post: by
8 posts views Thread by Mark Shroyer | last post: by
6 posts views Thread by _Who | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.