why does it not format all the text?
Why doesn't this CSS style format all the text on the page?
Code:
<style type="text/css">
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color:#000000;
}
</style>
If there is a table inside the body the font-size remains the same even if I change it in the code above to 1000px. The only way to format the text inside the table is to create a CSS code like the one above replace the tag body with the table tag.
You must have some other CSS, or perhaps some horrid presentational markup like <font>, overriding it.
Tables are cranky things that often refuse to inherit styles. You can use "body, td" as your selector or the ever so much more radical "*".
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
Originally Posted by
ray326
Tables are cranky things that often refuse to inherit styles. You can use "body, td" as your selector or the ever so much more radical "*".
'*' ? You rebel! Actually, I tested it in IE and Firefox and it worked. My guess is that something else is going on.
I usually style tables separately anyway so I guess I haven't noticed this recently.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
Originally Posted by
MstrBob
You must have some other CSS, or perhaps some horrid presentational markup like <font>, overriding it.
No I don't. It's just like I told you.
Full Code
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Teste</title>
<style type="text/css">
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}
</style>
</head>
<body>
Testing Verdana
<table align="left" border="1">
<tr>
<td>
Testing Verdana
</td>
</tr>
</table>
</body>
</html>
Check the attachment: testing.htm
I tested it both in Firefox 1.0.2 and in IE 6 and the result is the same.
Just another reason why you should use a valid DTD
At least 98% of internet users' DNA is identical to that of chimpanzees
Sorry Fang but I don't know what "DTD" means.
valid Document Type Definitions
The style will work correctly in IE6 but earlier version will still have problems: table inheritance bug
At least 98% of internet users' DNA is identical to that of chimpanzees
On my IE6 it still does not work.
But thanks for the explanation!!
In deed!
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Teste</title>
<style type="text/css">
body, html {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}
</style>
</head>
<body>
Testing Verdana
<table align="left" border="1">
<tr>
<td>
Testing Verdana
</td>
</tr>
</table>
</body>
</html>
At least 98% of internet users' DNA is identical to that of chimpanzees
Or
Code:
<style type="text/css">
body, table {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}
</style>
thank you
Last edited by gimbras; 03-31-2005 at 09:40 AM .
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks