473,394 Members | 1,813 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,394 software developers and data experts.

font-size inheritance IE6 problem

The following code works in firefox. But IE displays the hyperlink at
font-size=13 rather than font-size=10. Why? If its a known IE bug, how
should I fix it? I always want the hyperlinks to take the size of the
next parent element's class.

thanks for the help,
Shashi

<HTML>
<head><Title>Example For cellspacing</Title>
<style>
* {
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
}

a, a:visited {
font-size: inherit;
color: #0000FF;
text-decoration: none
}

a:hover {
color: #FF0000;
}

..footer {
color: #FFFFFF;
text-align: center;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 10px;
background-color: #999966;
}
</style>
</head>
<BODY>
<p class="footer">
this is <a href="#">a footer</athat you would never use.
</p>
</BODY>
</HTML>

Jul 13 '06 #1
15 2439
Replace * by body. Then every font in your page will be size 13px,
unless it is in an html element for which defined another font size, eg
your footer. That's why they call it "cascading" style sheets.

sr*******@gmail.com schreef:
The following code works in firefox. But IE displays the hyperlink at
font-size=13 rather than font-size=10. Why? If its a known IE bug, how
should I fix it? I always want the hyperlinks to take the size of the
next parent element's class.

thanks for the help,
Shashi

<HTML>
<head><Title>Example For cellspacing</Title>
<style>
* {
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
}

a, a:visited {
font-size: inherit;
color: #0000FF;
text-decoration: none
}

a:hover {
color: #FF0000;
}

.footer {
color: #FFFFFF;
text-align: center;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 10px;
background-color: #999966;
}
</style>
</head>
<BODY>
<p class="footer">
this is <a href="#">a footer</athat you would never use.
</p>
</BODY>
</HTML>
Jul 14 '06 #2
sr*******@gmail.com wrote:
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
http://k75s.home.att.net/fontsize.html

--
-bts
-Warning: I brake for lawn deer
Jul 14 '06 #3
On 2006-07-14, Beauregard T. Shagnasty wrote:
sr*******@gmail.com wrote:
> font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;

http://k75s.home.att.net/fontsize.html
Or, for a more accurate comparison:
<http://cfaj.freeshell.org/testing/verdana-helvetica.shtml>

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Jul 14 '06 #4
On Fri, 14 Jul 2006, Chris F.A. Johnson wrote:
On 2006-07-14, Beauregard T. Shagnasty wrote:
sr*******@gmail.com wrote:
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
http://k75s.home.att.net/fontsize.html

Or, for a more accurate comparison:
<http://cfaj.freeshell.org/testing/verdana-helvetica.shtml>
There's two things wrong with the cited snippet of CSS: the
specification in px units, and the use of Verdana alongside other
fonts.

http://k75s.home.att.net/fontsize.html addresses both issues (although
I have to disable my browser's minimum font size before I get to see
the effect which it's trying to demonstrate).

http://cfaj.freeshell.org/testing/ve...elvetica.shtml is a fine
comparison of two fonts at size 1em - or it would be for someone who
had Helvetica (mine is falling back to the browser's configured
default, which rather spoils the effect), but doesn't address the
(mis)use of px units at all.

sbpoley has shown how these demonstrations can be made safer by adding
monospace as the fallback font in the CSS, after the one that's
actually desired, and telling the reader that if they see monospace,
it means they haven't got the desired font.

Interesting bit of greeking, by the way.

regards
Jul 14 '06 #5
Veerle wrote:
Replace * by body. Then every font in your page will be size 13px,
unless it is in an html element for which defined another font size,
eg your footer. That's why they call it "cascading" style sheets.
The "cascade" refers to the author -browser-default -user-preference
succession of style sources, not to the business of style inheritance.

--
Jack.
Jul 14 '06 #6

Jack schreef:
Veerle wrote:
Replace * by body. Then every font in your page will be size 13px,
unless it is in an html element for which defined another font size,
eg your footer. That's why they call it "cascading" style sheets.

The "cascade" refers to the author -browser-default -user-preference
succession of style sources, not to the business of style inheritance.

--
Jack.
Oops, didn't know. I always figured it was because the elements in the
html inherit their style from their parent's style, except if it is
overruled. But after doing some research on the net, I see that you are
absolutely right!

I always go with the stylesheet of the author. I've never in my life
changed the style of a website I visit to my own or the browsers one.
And because a lot of the websites on the net don't seperate their
markup from style correctly (eg tables for layouting) I don't think
there's a lot of advantage in doing so. Except maybe for people who
can't read small fonts very well and want to set the font to a larger
one or change foreground and background color to very contrasting ones.
But even then, a lot of the websites on the internet use fixed font
sizes (like the example above) so it won't work anyway. The idea is
great, but in reality it doesn't always work because people can put
online as crappy html as they whish. But of course, it is good to
advise website authors not to do this, so maybe one day, most of the
websites get it right. Although I don't believe that will ever happen.

Jul 14 '06 #7
Alan J. Flavell wrote:
On Fri, 14 Jul 2006, Chris F.A. Johnson wrote:
>On 2006-07-14, Beauregard T. Shagnasty wrote:
>>sr*******@gmail.com wrote:

font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;

http://k75s.home.att.net/fontsize.html

Or, for a more accurate comparison:
<http://cfaj.freeshell.org/testing/verdana-helvetica.shtml>

There's two things wrong with the cited snippet of CSS: the
specification in px units, and the use of Verdana alongside other
fonts.

http://k75s.home.att.net/fontsize.html addresses both issues
Thenk yew. :-)
(although I have to disable my browser's minimum font size before I
get to see the effect which it's trying to demonstrate).
Do you think I should add a note to mention that? (Ok, I did.)
http://cfaj.freeshell.org/testing/ve...elvetica.shtml is a fine
comparison of two fonts at size 1em - or it would be for someone who
had Helvetica (mine is falling back to the browser's configured
default, which rather spoils the effect), but doesn't address the
(mis)use of px units at all.
No Helvetica here either.
sbpoley has shown how these demonstrations can be made safer by
adding monospace as the fallback font in the CSS, after the one
that's actually desired, and telling the reader that if they see
monospace, it means they haven't got the desired font.
Yes, good idea. Now that you mention it, I do remember reading it long
ago.
Interesting bit of greeking, by the way.
Yes. <g>

--
-bts
-Warning: I brake for lawn deer
Jul 14 '06 #8
Changed the styles from * to body and it worked. Thanks.

Interesting comments on Verdana by so many people.

But most of the sites used Verdana, thats the reason why I went that
route... Will have to rethink my strategy now I guess...
Google: Arial, 20px
Amazon.com: verdana,arial,helvetica,sans-serif; font-size: medium,
small etc
W3Schools: verdana,helvetica,arial,sans-serif; font-size: 100%
Slashdot: verdana; arial, san-serif;
Cricinfo: Arial, Helvetica, san-serif; font-sizes; 11px, 12px, 13px
CNN: Arial, Verdana, sans-serif font-sizes: 10px, 12px

thanks again guys... you have been very helpful...
shashi

Veerle wrote:
Replace * by body. Then every font in your page will be size 13px,
unless it is in an html element for which defined another font size, eg
your footer. That's why they call it "cascading" style sheets.

sr*******@gmail.com schreef:
The following code works in firefox. But IE displays the hyperlink at
font-size=13 rather than font-size=10. Why? If its a known IE bug, how
should I fix it? I always want the hyperlinks to take the size of the
next parent element's class.

thanks for the help,
Shashi

<HTML>
<head><Title>Example For cellspacing</Title>
<style>
* {
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
}

a, a:visited {
font-size: inherit;
color: #0000FF;
text-decoration: none
}

a:hover {
color: #FF0000;
}

.footer {
color: #FFFFFF;
text-align: center;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 10px;
background-color: #999966;
}
</style>
</head>
<BODY>
<p class="footer">
this is <a href="#">a footer</athat you would never use.
</p>
</BODY>
</HTML>
Jul 14 '06 #9
On 2006-07-14, Alan J. Flavell wrote:
On Fri, 14 Jul 2006, Chris F.A. Johnson wrote:
>On 2006-07-14, Beauregard T. Shagnasty wrote:
sr*******@gmail.com wrote:

font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;

http://k75s.home.att.net/fontsize.html

Or, for a more accurate comparison:
<http://cfaj.freeshell.org/testing/verdana-helvetica.shtml>

There's two things wrong with the cited snippet of CSS: the
specification in px units, and the use of Verdana alongside other
fonts.
You must be looking at a different page; there is no "px" anywhere
on it.

Using Verdana alongside another font is the whole point of the
exercise.
http://k75s.home.att.net/fontsize.html addresses both issues (although
I have to disable my browser's minimum font size before I get to see
the effect which it's trying to demonstrate).

http://cfaj.freeshell.org/testing/ve...elvetica.shtml is a fine
comparison of two fonts at size 1em - or it would be for someone who
had Helvetica (mine is falling back to the browser's configured
default, which rather spoils the effect), but doesn't address the
(mis)use of px units at all.
I wasn't addressing the use of px units; I don't use them. I was
pointing out that there is nothing wrong with using Verdana.
sbpoley has shown how these demonstrations can be made safer by adding
monospace as the fallback font in the CSS, after the one that's
actually desired, and telling the reader that if they see monospace,
it means they haven't got the desired font.
Good idea -- for demonstrations.
Interesting bit of greeking, by the way.
It's some paragraphs from Chapter 1 of Oliver Twist fed through:

str1=aeiouybcdfghjklmnpqrstvwxyzAEIOUYBCDFGHJKLMNP QRSTVWXYZ
str2=eioayfcdbghukjnpmvsqlrwtzyxEIOAYUCDBGHFKJNPMR VWLTSQZYX
sed -e "s/^'/\"/" \
-e "s/' /\" /g" \
-e "s/ '/ \"/g" \
-e "s/'$/\"/g" \
-e 's/\r//' | tr $str1 $str2
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Jul 14 '06 #10
On Fri, 14 Jul 2006, Chris F.A. Johnson wrote:
On 2006-07-14, Alan J. Flavell wrote:
On Fri, 14 Jul 2006, Chris F.A. Johnson wrote:
On 2006-07-14, Beauregard T. Shagnasty wrote:
sr*******@gmail.com wrote:

font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;

http://k75s.home.att.net/fontsize.html

Or, for a more accurate comparison:
<http://cfaj.freeshell.org/testing/verdana-helvetica.shtml>
There's two things wrong with the cited snippet of CSS: the
specification in px units, and the use of Verdana alongside other
fonts.

You must be looking at a different page;
No, I'm looking at the "cited snippet of CSS", which you helpfully
re-quoted, but seem to have ignored.
there is no "px" anywhere on it.
Feel free to look at it again, then:
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
http://cfaj.freeshell.org/testing/ve...elvetica.shtml is a fine
comparison of two fonts at size 1em - or it would be for someone who
had Helvetica (mine is falling back to the browser's configured
default, which rather spoils the effect), but doesn't address the
(mis)use of px units at all.

I wasn't addressing the use of px units;
Confirmed. But I already said that.
I was pointing out that there is nothing wrong with using Verdana.
I drew the opposite conclusion from your demonstration, though.

cheers
Jul 14 '06 #11
Veerle wrote:
The idea is great, but in reality it doesn't always work because
people can put online as crappy html as they whish. But of course, it
is good to advise website authors not to do this, so maybe one day,
most of the websites get it right. Although I don't believe that will
ever happen.
Hey, that's normal; in the real world, most things suck, and good stuff
is very rare. It'll never be different. But if people who can tell the
difference don't insist on quality, the good stuff will become even rarer.

That's philosophy.

--
Jack.
Jul 14 '06 #12
On 2006-07-14, Alan J. Flavell wrote:
On Fri, 14 Jul 2006, Chris F.A. Johnson wrote:
>On 2006-07-14, Alan J. Flavell wrote:
On Fri, 14 Jul 2006, Chris F.A. Johnson wrote:

On 2006-07-14, Beauregard T. Shagnasty wrote:
sr*******@gmail.com wrote:

font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;

http://k75s.home.att.net/fontsize.html

Or, for a more accurate comparison:
<http://cfaj.freeshell.org/testing/verdana-helvetica.shtml>

There's two things wrong with the cited snippet of CSS: the
specification in px units, and the use of Verdana alongside other
fonts.

You must be looking at a different page;

No, I'm looking at the "cited snippet of CSS", which you helpfully
re-quoted, but seem to have ignored.
>there is no "px" anywhere on it.

Feel free to look at it again, then:
> font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
Sorry; I should have snipped that from my first post; it is not
relevant to my point.

[snip]
>I was pointing out that there is nothing wrong with using Verdana.

I drew the opposite conclusion from your demonstration, though.
On what grounds?

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Jul 14 '06 #13
Veerle <ve*********@hotmail.comwrote:
I always go with the stylesheet of the author. I've never in my life
changed the style of a website I visit to my own or the browsers one.
I usually leave the author's style sheet in place too, unless I need to
switch to my browser's User Mode (which disables a lot more than the
author's style sheet).

My user style sheet has just a few !important rules that target specific
problems. Combined with browser settings like Minimum Font Size, it reduces
the need to switch to User Mode. It isn't a complete design of its own, and
I don't replace the author's style sheet with my user style sheet.

Unless the design is so bad that I switch to User Mode, that is.
Except maybe for people who can't read small fonts very well and want to
set the font to a larger one or change foreground and background color to
very very contrasting ones.
No one can read "small fonts" very well. It's just that the definition of
"small fonts" varies from person to person, and from display environment to
display environment. On my high-res displays, a minimum font size of 12px
is comfortable and reasonable to me. In some other display environment or
for someone with better/worse vision than mine, 12px might be huge or
illegibly small.
But even then, a lot of the websites on the internet use fixed font
sizes (like the example above) so it won't work anyway.
Says who? The rule

html, body { font-size: 100% !important ; }

goes a long way. Throw in Minimum Font Size and you can repair a lot of
microfont problems automatically.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"There is no right way to do the wrong thing."
Jul 14 '06 #14
On Fri, 14 Jul 2006, Darin McGrew drags above the scorefile horizon
that:
Veerle <ve*********@hotmail.comwrote:
But even then, a lot of the websites on the internet use fixed font
sizes (like the example above) so it won't work anyway.
The reality is that there is no such thing as "fixed font sizes" on
the WWW.

Even if you specify CSS px units, or pt units, you'll have a hard time
finding a display on which they are displayed in full and accurate
conformance with the applicable specifications.

Over and above the fact that different users have different needs,
your supposed "fixed" font sizes are going to end up different anyway.

Knowing that px and pt units not only don't work to specification but
aren't what the user needs, it isn't too hard to make a good choice,
IMHO.
Says who? The rule

html, body { font-size: 100% !important ; }

goes a long way. Throw in Minimum Font Size and you can repair a lot of
microfont problems automatically.
Indeed.

Jul 14 '06 #15

"Jack" <mr*********@nospam.jackpot.uk.netwrote in message
news:e9*******************@news.demon.co.uk...
The "cascade" refers to the author -browser-default -user-preference
succession of style sources, not to the business of style inheritance.
Yes, it's about precedence, not inheritance, but not specifically three
style sources. The cascade can include multiple stylesheets from one or more
sources.

http://www.w3.org/TR/CSS1#the-cascade

Daibhidh

Jul 18 '06 #16

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

Similar topics

1
by: Justin Van Patten | last post by:
Hello, I am having trouble converting a LOGFONT structure to a System.Drawing.Font object. I'm calling SystemParametersInfo to get the LOGFONT lfntSMCaptionFont from a NONCLIENTMETRICS...
1
by: Stephen | last post by:
I am unable to get intelligent font matching to work. I used a @font-face with a Panose-1 descriptor. I tried it with both Internet Explorer 6 and Firefox on Windows 98 SE. The Panose numbers are...
3
by: Wim | last post by:
I would like to store the ListView font in the XML config file. So I have a string variable listFont that stores the font (font.ToString()). It must be a string variable because a Font object...
6
by: ryan.mclean | last post by:
Hi all! I was hoping someone could help me out. What I would like to do is use a font that is not installed on the server, but does reside in my local web. Does that make sense? I would like to...
6
by: Mika M | last post by:
Hi! I'm trying to print barcodes paper printings of my VB .NET (2003) Windows forms application. Earlier I used Code39.TTF (True Type Font) with VB6, and it was working fine, but now can't get...
4
by: BobAchgill | last post by:
Is it possible to use a font that is not stored in the windows font directory? I would like to use a font that is stored in my application directory... But this does not seem to work... ...
3
by: dave | last post by:
Hello: I have array of Label controls allocated danamically. When I'm trying to change font as: LabelLeft.Font.Strikeout = false; I have error: "Property or indexer...
1
by: Henry Jones | last post by:
I found some code to change the font on a button to bold: private void btnBold_Click(object sender, System.EventArgs e) { btnCalculate.Font = new Font(btnCalculate.Font, ...
24
by: Tony Girgenti | last post by:
Hello. Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a windows XP Pro, SP2. Before printing a document, i want to set the font to a font that is only available...
16
by: carlbernardi | last post by:
Hi, I was wondering if there is way use a font that is somehow kept in the code instead of having to load it? I am working on a single script that so far can produce images and html but I have...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
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...

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.