CSS "font: smallcaption; font-weight: bold;" problem

purplesoup
purplesoup used Ask the Experts™
on
I've discovered that a css class I use ignores the font-weight:bold attribute with viewed in Internet Explorer 8 compatibility mode.

The code below replicates the problem - the first message appears bold in Firefox and IE 8, but isn't bold in IE 8 compatibility view.

Why is this and how can I set these attributes and get them all accepted in all browsers?
<html>

<style type="text/css">

.Important
{
	font: smallcaption;
	font-weight: bold;
	color: Red;
}

</style>

<body>

<div class="Important">This is message 1</div>

<hr />

<div>message 2</div>

</body>
</html>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Commented:
Try this - You're missing font-size part for IE.

Regards

.Important
{
		font-weight: bold;
		font-family: small-caption;
		font-size: 12px;
        color: Red;
}

Open in new window

purplesoupProgrammer

Author

Commented:
Doesn't make any difference - still doesn't display bold in IE, and the size was wrong - it needed to be 16px to get the text to appear the right size on Firefox.
Top Expert 2010

Commented:
I put 12px just as an example.
Tested this in IE6, IE7, IE8, IIE8 compaitbility view, Firefox, Opera and Safari and message 1 is bold and red in every single one.
If its not a problem to You, can You describe what You want to achieve?

Regards
purplesoupProgrammer

Author

Commented:
ok I see what you've done. You didn't just change the font-size, you changed

      font: smallcaption;
to
        font-family: small-caption;

that combined with a font-size: 16px gets the equivalent output on both browsers.

Thanks.
Top Expert 2010
Commented:
Sometimes, little things can make You spent a couple of hours.
Glad that I helped You.

Bosko

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial