473,412 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

This one CSS instance is really stumping me!

This is really stumping me. I don't know how many time's I've done
this, but on this one particular case it is not working.

My CSS says this:

#footer{
color:#888;
font-size:20px;
}

h3{
font-family: Sylfaen, Georgia, "Times New Roman", Times, serif;
font-weight:normal;
letter-spacing: -1px;
margin:0;
}

This is the only reference to h3 in my CSS file.

It is used here:

<div id="footer">
<h3(c) Copyright 2006</h3>
</div>

Unlike all other instances of using px for font-size units, in this one
case only, the resulting <h3is of significantly different size when
viewed in Firefox vs. IE.

I cannot for the life of me figure out why this must be. I have plenty
of other CSS styles linked that do this exact sort of thing, using px
units, and they behave identically between the two browsers, because
afterall pixels are pixels, no matter what software you are using.

But this one doesn't!

Any ideas? I've studied these little snippets of code for hours and
can't understand.

Thanks
-j

Aug 19 '06 #1
7 1416
On 19 Aug 2006 11:16:36 -0700, Jaxon Bridge wrote:
My CSS says this:

#footer{
color:#888;
font-size:20px;
}

h3{
font-family: Sylfaen, Georgia, "Times New Roman", Times, serif;
font-weight:normal;
letter-spacing: -1px;
margin:0;
}

This is the only reference to h3 in my CSS file.

It is used here:

<div id="footer">
<h3(c) Copyright 2006</h3>
</div>

Unlike all other instances of using px for font-size units, in this one
case only, the resulting <h3is of significantly different size when
viewed in Firefox vs. IE.
Define the size of <h3>, preferably in relative units (%, em).

Make life easier to the ones you're asking help from and post your link.

--
buy, bought, bye
Aug 19 '06 #2
On 2006-08-19, Jaxon Bridge wrote:
This is really stumping me. I don't know how many time's I've done
this, but on this one particular case it is not working.

My CSS says this:

#footer{
color:#888;
font-size:20px;
}

h3{
font-family: Sylfaen, Georgia, "Times New Roman", Times, serif;
font-weight:normal;
letter-spacing: -1px;
margin:0;
}

This is the only reference to h3 in my CSS file.

It is used here:

<div id="footer">
<h3(c) Copyright 2006</h3>
</div>
It seems a little perverse to use a header in a footer! Why not
just style div#footer and leave out the <h3>?
Unlike all other instances of using px for font-size units, in this one
case only, the resulting <h3is of significantly different size when
viewed in Firefox vs. IE.
There are many reasons not to use px size for fonts (and many other
things). Browsers handle their resizing differently, if at all.
I cannot for the life of me figure out why this must be. I have plenty
of other CSS styles linked that do this exact sort of thing, using px
units, and they behave identically between the two browsers, because
afterall pixels are pixels, no matter what software you are using.

But this one doesn't!

Any ideas? I've studied these little snippets of code for hours and
can't understand.
Use relative sizes for all your fonts. Set the basic size:

body { font-size: 1em; }

Then adjust all other sizes relative to that:

h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }

Etc....

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Aug 19 '06 #3
>
body { font-size: 1em; }

Then adjust all other sizes relative to that:

h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }
Oh wow, I've been warned against this approach big time from all the
CSS reading I've been doing. It is my understanding that at some point
in the chain, you must have a parent that defines the fixed font size,
so everything that uses "em" can be adjusted to that. In your example,
there are no fixed font sizes on up the chain, so the em has no
original point of reference. This can cause sites to look very
different on different browsers, whereas using "px" or a sensible
combination of "px" and "em" will make it look identical on all
browsers.

I guess there are different schools of thought on this, but leaving
everything to an "em" is too unpredicatable. See this page:

http://www.bigbaer.com/css_tutorials/css_font_size.htm

-J

Aug 19 '06 #4
Jaxon Bridge wrote:
It is my understanding that at some point
in the chain, you must have a parent that defines the fixed font size,
so everything that uses "em" can be adjusted to that. In your example,
there are no fixed font sizes on up the chain, so the em has no
original point of reference. This can cause sites to look very
different on different browsers, whereas using "px" or a sensible
combination of "px" and "em" will make it look identical on all
browsers.

I guess there are different schools of thought on this, but leaving
everything to an "em" is too unpredicatable. See this page:

http://www.bigbaer.com/css_tutorials/css_font_size.htm
The hypotheses, different as to causation and outcome, are false. They
can be tested simply. In my view, for the common author (like me), it
is not a matter of logic or thought but of practical method.

As a case in point, in spite of the statements on the referenced page,
take a look at the authors style sheet (not that I am an apologist for
it, especially the font family set).

If you haven't already it may be worthwhile consulting,
http://www.w3.org/TR/REC-CSS2/fonts.html

Also consider that the client may have created a User Style Sheet,
http://www.w3.org/TR/CSS-access

In my experience, applying a font sizing rule to the body selector makes
for complexities in later styling child elements where the preference is
for absolute and relative font size values.
Louise



Aug 20 '06 #5
On 2006-08-19, Jaxon Bridge wrote:
>>
body { font-size: 1em; }

Then adjust all other sizes relative to that:

h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }

Oh wow, I've been warned against this approach big time from all the
CSS reading I've been doing. It is my understanding that at some point
in the chain, you must have a parent that defines the fixed font size,
so everything that uses "em" can be adjusted to that. In your example,
there are no fixed font sizes on up the chain, so the em has no
original point of reference. This can cause sites to look very
different on different browsers, whereas using "px" or a sensible
combination of "px" and "em" will make it look identical on all
browsers.

I guess there are different schools of thought on this, but leaving
everything to an "em" is too unpredicatable. See this page:

http://www.bigbaer.com/css_tutorials/css_font_size.htm
I wouldn't trust anyone whose page has a line like this:
<http://cfaj.freeshell.org/web/examples/bigbaer.jpgto make
pronouncement on CSS.

And such and obviousy wrong statement as: "In conclusion, pixel
(.px) sized fonts offer reliable control and consistant scaling
across devices" doesn't add credibility. Px sizing offers nothing,
as different browsers treat it differently, and it makes no
allowances for the differently size pixels on different screens.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Aug 20 '06 #6
Chris F.A. Johnson <cf********@gmail.comscripsit:
><div id="footer">
<h3(c) Copyright 2006</h3>
</div>

It seems a little perverse to use a header in a footer!
Not necessarily. You may well have a footer that contains, say, copyright
information that starts with a header, like <h2>Copyright information</h2>.
(I would expect it to be 2nd level heading, not 3rd level - where would the
intermediate level be?) Naturally you should then use a few pieces of CSS to
make the appearance good and not the default <h2rendering (removing or
reducing margins, setting the font size to something sensible like 1.2em or
even 1em, etc.).

What is perverse here is that the <h3is not a heading for anything: there
is nothing after it inside the <divelement. It's also a rather pointless
statement since it does not specify the copyright holder; a sensible
statement would be "&copy; 2006 Jaxon Bridge".
h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }
While that's generally a good, simple approach to font sizes for heading
(ignoring here the issue of actual size factors, which depends on the page
and its styling in general), you would need to use something a little more
elaborated _if_ you use headings e.g. in footers. Assuming you have a
copyright info footer, starting with a <h2heading, you probably want that
<h2to appear in a much smaller font than normal <h2headings on the page,
so you'd use something like
..footer h2 { font-size: 1.2em; }

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 20 '06 #7
On 19 Aug 2006 16:33:20 -0700, "Jaxon Bridge" <ja**********@gmail.com>
wrote:
>body { font-size: 1em; }

Then adjust all other sizes relative to that:

h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }

Oh wow, I've been warned against this approach big time from all the
CSS reading I've been doing.
I wonder what you've been reading then. Whatever it is, I suggest you
consider deleting/recycling it.
It is my understanding that at some point
in the chain, you must have a parent that defines the fixed font size,
so everything that uses "em" can be adjusted to that.
Yes. The 'parent' as you put it, is the size that the user has defined
as being a text size which he/she finds pleasant to read on his/her
screen (which may or may not be the browser installation-default
setting).
In your example,
there are no fixed font sizes on up the chain,
Correct as far as the author-defined markup is concerned.
so the em has no
original point of reference. This can cause sites to look very
different on different browsers, whereas using "px" or a sensible
combination of "px" and "em" will make it look identical on all
browsers.
Wrong for two reasons:
1) It will not make it look identical in all browsers, as (a) good
browsers (i.e. almost everything except IE) provide the reader with the
means of overriding pixel settings; (b) there are many different
monitors and video cards in the world;
2) It is not desirable that it looks identical on all browsers, or even
for all users of a single browser. You have no idea what my eyesight is
like, and cannot know whether I like the text to be the same size as,
say, my son. (As it happens, I don't - but you still don't know which
text sizes we like).
>I guess there are different schools of thought on this, but leaving
everything to an "em" is too unpredicatable.
There is only one school of thought among people who understand the web.
Unfortunately there are a good many people who have set themselves up as
web designers who either don't understand the web at all or haven't
upgraded their knowledge since about 1998.

And the em is well-defined and completely predictable. (Apart from an IE
bug which can be worked around by setting the body default size to
100%).

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Aug 20 '06 #8

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

Similar topics

2
by: Dan Rubin | last post by:
OK, I apparently am not as swift with CSS as I thought. I am trying to put together a very light-weight page layout for our clients to use as a main admin link page for projects (based on Jay...
4
by: Piotr Perak | last post by:
Can someone explain the "object instance" term that is used i many of C# books? I have C++ background. In C++ instance and object meant the same. I could say that I have object of some class or...
3
by: Dave | last post by:
Hi, I need a little help in understanding why FxCop complains about this. If I have a basic class like: class Class1 { static void Main()
14
by: Charles Jenkins | last post by:
I want to make a MenuItem that I can 'click' programmatically. I started by coding this: class ClickableMenuItem : MenuItem { public void DoClick( EventArgs e ) { OnClick( e ); } ...
8
by: nytimescnn | last post by:
I've read some discuession about lock() for thread-safe. I am wondering what will be the differce between below two code segment? Code 1: class A { private static Object padlock = new...
7
by: beginner | last post by:
Hi Everyone, I have encountered a small problems. How to call module functions inside class instance functions? For example, calling func1 in func2 resulted in a compiling error. "my module...
4
by: Dominik Gallus | last post by:
Hey there, What i know is that a delegate is a (address)reference to a method or a object-instance's method. But how can i have a reference JUST to a object instance? Is this also done by...
19
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
I'm doing my c# more and more like i used to code c++, meaning i'm casting more often than creating an instance of objects. like : protected void gvOrderDetailsRowDataBound(object sender,...
45
by: Bob Altman | last post by:
This code (Visual Studio 2005) should generate a compilation warning to the effect that I'm accessing a shared member through an instance variable (the "color" variable): Private Sub X(ByVal...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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...
0
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...

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.