Forum Moderators: not2easy
<html>
<head>
<style>
<!--
table
{
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
}
input, .smaller
{
FONT-SIZE: 50%
}
-->
</style>
</head>
<body>
<form method="post">
<table>
<tr>
<td>
<span class="smaller"><label for="txtTest">Label:</label></span>
</td>
<td>
<input type="text" name="txtTest" id="txtTest" value="test text"></input>
</td>
</tr>
</table>
</form>
</body>
</html>
Haven't found anything any shorter and sweeter than that. But it's still better than filling the page with countless <font> tags, eh?
Any CSS gurus out there with a better idea? Please?
<td>
<span class="smaller">
<select size="1">
<option>option1</option>
<option>option2</option>
</select>
</span>
</td>
This works in Netscape, but IE 5.5 doesn't inherit the <span class="smaller">, and renders the listbox full size! This is a bug! However, if you change it to:
<td>
<span class="smaller">
<select size="1" class="smaller">
<option>option1</option>
<option>option2</option>
</select>
</span>
</td>
Netscape, as usual, ignores the class="smaller" on the select, so comes out looking okay. But IE 5.5, now correctly inherits the <span class="smaller"> and renders the listbox at 25%. The workaround to make IE 5.5. inherit the <span> I found is to do this:
<style>
.smaller {FONT-SIZE: 50%}
.fullsize {FONT-SIZE: 100%}
</style>
...
<td>
<span class="smaller">
<select size="1" class="fullsize">
<option>option1</option>
<option>option2</option>
</select>
</span>
</td>
It appears that having any class attribute on the select causes it to avoid the bug and inherit. I don't know if this applies to any other version of IE.
Every time I read [richinstyle.com...] and see the hundreds of CSS bugs the various browsers have, the more I just get annoyed. I've given up on being annoyed at Netscape, as their use of CSS is so bad that you just have to work around it, but I expect more of IE.
If anyone has any better ideas, I'd really like to know.
Have you tried redefining the actual tag in the style sheet? i.e. set up input and every input box will inherit those attributes..you can do this for the select tag as well.
and of course you can have 2 style sheets - one for netscape the other for Explorer.