473,549 Members | 2,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="rightMenuBo dy">
<div id="rightMenuTe xt">
<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 9256
> 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="rightMenuBo dy">
<div id="rightMenuTe xt">
<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=".linkcol or('Home Page').">
<a href='index.php ?nav=Home Page'>Home Page</a>
</span></p>

<p><span class=".linkcol or('Contact')." >
<a href='contact.p hp?nav=Contact' >Contact</a>
</span></p>

<p><span class=".linkcol or('Services'). ">
<a href='services. php?nav=Service s'>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.c om> 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****@stanford alumni.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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11253
by: Al Dykes | last post by:
I'm playing around with FireFox and RSS for the first time and I'm getting this error "This XML file does not appear to have any style information associated with it. The document tree is shown below." There is a "use this style sheet" entry in the properties for RSS that is blank in the fresh install (XP). I've tried putting the path...
12
3685
by: Tony Carnell | last post by:
Hi, Here's a conundrum that I hope someone out there can help me solve. I've created a page to XHTML 1.0 Transitional / CSS standards using Macromedia Dreamweaver MX 2004 (and validated both with no problems). Whilst creating the page I've previewed it in IE 6, FireFox 0.8 and Opera 7.21 on my PC and the page displays perfectly (well, as...
14
24203
by: David Blickstein | last post by:
I have some XML documents that I want to open in a web browser and be automatically translated to HTML via XSLT. I'm using an xml-stylesheet processing command in a file called "girml.xml". This all works in Internet Explorer, but doesn't work with Firefox. In both IE and Firefox this works: <?xml-stylesheet type="text/xsl"...
3
3295
by: gdelfino | last post by:
I have an XML file which I transform into XHTML using stylesheetA.xsl. I also have stylesheetB.xsl which transforms my XML file into an Excel XML document. As both Excel and most new browsers have a built in XSTL engine, I decided to add the stylesheet information to the original XML file. Like this <?xml version="1.0" encoding="utf-8"...
3
5501
by: juergen.riemer | last post by:
Hi all, I have a problem in attaching an external stylesheet to a newly created iframe in Firefox (1.5.0.2). If I use the code below (with a relative address to the file) the stylesheet would not be applied. I have to indicate the absolute path: var uriStylesheet = "http://localhost:8080/panel/styles.css"; to make it work in Firefox. NB:...
2
2875
by: Jim Carr | last post by:
Upon entering the site www.FutureByDesign-Music.com with IE6, my clipboard is erased and then disabled in all other Windows XP applications. Navigating to another site returns clipboard functionality, but whatever was on the clipboard before is lost. If I disable running JavaScript on the page, the clipboard is unaffected. Viewing the page...
4
7712
by: th1421 | last post by:
Hi, I'm new to FireFox. I am currently trying to convert my website to be compatible with it. Doing so I’m trying to process some XML/XSLT pages (preferably without using JavaScript). When I view my XML pages using IE 6 or 7 it displays beautifully both accessed locally as through HTTP on my ISP’s server where I put them using FTP. When I...
8
2331
by: Mark Shroyer | last post by:
I just completed a new design for a personal web site. After finishing the basic CSS stuff and double-checking it in Safari, FF, Opera, et al., I put on my war paint and fired up IE7 to figure out what kind of hacks I'd have to apply. Delightfully, IE7 only needed four or five tweaks this time around... But next I opened the test page in...
6
2543
by: _Who | last post by:
I use the code below to change to a style sheet that has: body { ....
0
7480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7751
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7992
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7511
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7840
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6088
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5396
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5119
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...

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.