Jagadesh
Jagadesh

Reputation: 6807

Font selector style css class not working in IE

Hi I am having a style class for font tag, If size of the attribute is 1. I am setting the following style. font[size = 1] { font-size : small; } It works in FF , chrome but not in IE

Can anyone explain how to make that work in IE?

Upvotes: 1

Views: 755

Answers (4)

Bruno Le Duic
Bruno Le Duic

Reputation: 261

What if you specify 1pt like font[size = 1pt] { font-size : small; }

Upvotes: 0

Mario Fink
Mario Fink

Reputation: 684

I would recommend to not use the font tag at all. It has no semantic meaning. A better way would be to create a class that holds your desired font style. You can then simply assign this class to any element that you want to apply that style to.

E.g.: CSS

.smallType {
    font-size: small;
}

HTML

<p class="smallType">Hey, look at me! I'm small!</p>

Upvotes: 0

Kyle
Kyle

Reputation: 67194

The <font> tag has been deprecated and probably won't work as you expect. This is old, old, old technology. You should wrap it in a span or other element (depending on usage) with a class:

HTML

<span class="myClass">Text example here!</span>

CSS

.myClass
{
    font-size: small; /*whatever you need*/
}

This is supported by all browsers as it's standard CSS.

:)

Upvotes: 1

Andre Backlund
Andre Backlund

Reputation: 6943

The font tag is deprecated and should die. Please use paragraph tags (<p>), or span (<span>) to style specific text inside a paragraph tag instead.

<style type="text/css">
.pClass{
    color:red;
}
.spanClass{
    font-size:small;
}
</style>
<p class="pClass">This is <span class="spanClass">my paragraph</span>, it contains text</p>

Upvotes: 1

Related Questions