Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

whats wrong with this style sheet?

Status
Not open for further replies.

AndyApp

Programmer
Dec 20, 2001
259
GB
can anyone please point out what's wrong with this style sheet? Everything works fine except I can't change the font size for the body text. No matter what i set it to it just defaults to 16px. i've tried everything, %, xx-large etc, etc but nothing.

There are no <FONT> tags on the page and no <STYLE> either. There are just references to the classes that exist in the style sheet.

.TableHeaderText
{
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #FFFFFF;
font-weight: bold;
text-align: center
}
.RelatedLinksTitle
{
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #000000;
}
a
{
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #FF0000;
text-decoration: underline;
}
a:hover
{
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #990000;
text-decoration: none;
}
Body
{
font-family: Arial, Helvetica, sans-serif;
color: #000000;
font-size: 14px;
}

&quot;Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway&quot; - Jim Davis (Garfield)
 
your style sheet validates, so no apparent problem there.

can you post a link to the page, or post the associated html?

(btw, when you post, you can use [ignore]
Code:
 code goes here
[/ignore]
tags - it makes it much easier to read [smile])
Code:
 code here

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Does it work if you change the size in points rather than pixels? That's worked for me in the past.
 
no it doesn't work no matter what i use. point/pixels/% nothing.

&quot;Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway&quot; - Jim Davis (Garfield)
 
You have attached the class "PageScrollbarColor" to your <body> tag. This will override or at the very least conflict the the Body style.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
pixl8r - thought you'd cracked it then. If I remove that class it still does the same. Also tried removing all references to classes but nothing.

&quot;Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway&quot; - Jim Davis (Garfield)
 
is ok, sussed it.

It was because the text wasn't actually written in the <body> (apparently, although i think that a strange querk!). When i changed body for table in the style sheet it worked.

DOH!

&quot;Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway&quot; - Jim Davis (Garfield)
 
Some browsers (not IE for once, IIRC) don't properly cascade text properties from the <body> tag into table cells. It's a bug. To be safe, instead of writing
Code:
body
{
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  font-size: 14px; 
}
write this instead to explicitly force the cascade:
Code:
body, table, tr, th, td
{
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  font-size: 14px; 
}  

-- Chris Hunt
[URL unfurl="true"]http://www.mcgonagall-online.org.uk[/URL]
[URL unfurl="true"]http://www.napitalia.org.uk[/URL]
[URL unfurl="true"]http://www.leicesteryha.org.uk[/URL]
 
Has anyone ever used the 'View --> Text-size --> Larger' option in IE?

Yep, you guessed it, it makes the text larger. It's a built-in accessibility feature.

Unfortunately, if you set the font-size in px, this won't scale in IE (unsurprisingly, it does in Moz and Opera...) so if possible, set it to use em or %.

There's some helpful info in Checkpoint 3.4 of the WAI (Web Accessibility Initiative).

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top