473,785 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>Ex ample 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 2459
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>Ex ample 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,h elvetica,sans-serif; font-size: medium,
small etc
W3Schools: verdana,helveti ca,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>Ex ample 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=aeiouybcdf ghjklmnpqrstvwx yzAEIOUYBCDFGHJ KLMNPQRSTVWXYZ
str2=eioayfcdbg hukjnpmvsqlrwtz yxEIOAYUCDBGHFK JNPMRVWLTSQZYX
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

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

Similar topics

1
4190
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 structure. I seem to be doing this correctly, but when I try to create a System.Drawing.Font object with the Font.FromLogFont, the new Font object has a different Name than the LOGFONT.
1
3490
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 from the Windows Registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Panose. I am unsure if I made a coding error, or if the browsers do not support intelligent font matching, or if there is some other cause. In the example shown...
3
26567
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 cannot be written to the XML config file. Next time the program is started the font is read from the config file. But how to convert the string to a Font object? -- Wim
6
1921
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 take the responsibility off the server administrator and put it back on the developers. I realize I may be asking for the impossible, but any ideas are appreciated. The application is creating an image object and Response.OutputStream them.
6
2430
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 barcodes with VB .NET with the same font !? I downloaded demo .OTF-barcode font (Open Type Font), and using it with VB.NET I can get barcode printings using Crystal Reports .rpt-files of my application, and using Printing.PrintDocument too. I'm...
4
1942
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... rtbMyRichTextBox.SelectionFont = New Font(CurDir() + "\" + "MyFont.ttf", 12, FontStyle.Bold) Thanks!
3
9443
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 'System.Drawing.Font.Strikeout' cannot be assigned to
1
2727
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, btnCalculate.Font.Style | FontStyle.Bold);
24
2841
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 with the printer that i am printing to(Zebra TLP2844). When i open Word and look at the fonts available for the default printer, it does not show the fonts i want. If i cahnge the printer to the printer that
16
1884
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 not been able to figure out a way that it can also produce a font. Thanks Carl
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10336
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9953
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8978
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5383
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.