johnlikesit
johnlikesit

Reputation: 141

Does IE ignores custom css selectors?

IE is freaking me out.

my css code looks like this:

kl {
    font-size:10pt;
    font-weight: bold;
    color:#6e90a6;
}

and my html code looks like this:

<div id="testid"><kl>test</kl>

Why does IE ignore my CSS code?

Upvotes: 2

Views: 1132

Answers (5)

Dorjan
Dorjan

Reputation: 2037

You're making custom tags? IE deals with custom tags differently than other browsers.

Why not use span and a class, I think IE6 might respond better, just a might.

<div id="testid"><span class="kl">test</span></div>

.kl {
    font-size:10pt;
    font-weight: bold;
    color:#6e90a6;
}

Upvotes: 8

Sampson
Sampson

Reputation: 268344

Ajaxian authored an article in late 2008 that addressed the imlementation of custom tags in IE, along with the application of CSS to said tags. You can read the short paper here:

Adding Custom Tags To Internet Explorer, The Official Way

Upvotes: 2

Zoidberg
Zoidberg

Reputation: 10323

I would use a css class or an id, but if YOU MUST have your custom tag, then I believe you need to define your tag in the XSL and then include that in your page in order for IE to recognize it.

Upvotes: 4

Mickel
Mickel

Reputation: 6696

Kl? Try this...

CSS:

#testid span {
    font-size:10pt;
    font-weight: bold;
    color:#6e90a6;
}

HTML:

<div id="testid"><span>test</span></div>

Upvotes: 2

eddieroger
eddieroger

Reputation: 523

Why wouldn't you do this for your css:

#testid (
    font-size:10pt;
    font-weight: bold;
    color:#6e90a6;
}

That should work. Although you should know IE (especially <7) is less than CSS compliant.

Upvotes: 0

Related Questions