views:

212

answers:

5

Hey guys,

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?

Please could someone help me :)?

Update: Great responses guys, that was really fast :)

Thank you all! Such a great site here :)

I wanted to create a custom tag because of several headlines. but I think I going to use Dorjans way because of the good compatibility of all browsers!

Have a nice day.

A: 

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.

LunchboxG5
You did not answer his question.
Jonathan Sampson
@Jonathan, you're being anal
SilentGhost
@Silent, Yes. I am. The guy asked a question regarding custom tags. It's acceptable to offer an alternative, but don't neglect his question.
Jonathan Sampson
+6  A: 

You're making custom tags? IE deals with custom tags differently than other browsers see my link below for more details.

http://ajaxian.com/archives/adding-custom-tags-to-internet-explorer-the-official-way

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;
}
Dorjan
Why didn't I? I said "IE6 might respond better if he does it this way"But OK
Dorjan
OK how about now?
Dorjan
Much better now ;)
Jonathan Sampson
Then remove your vote down please :D
Dorjan
Already did, and gave you an upvote for the best answer so far.
Jonathan Sampson
I noticed! Sorry, I've had a few down votes today with no explainations... so thank you for explaining why on this one, and I'll make sure i'm more on target for future answers.
Dorjan
Dorjan, just for the record, I think you offered a sensible alternative. I just get upset when people don't address my questions, and only offer alternatives - this is a great opportunity to shine some light on custom tags in IE, which you did - thanks, man!
Jonathan Sampson
Indeed, and after you pointed it out I realised how annoyed I would be too. "Yeah I know the other way works but WHY doesn't this work!!" would be going through my mind from my first answer.Cheers bro.
Dorjan
@Dorjan, Glad you see my point. Others here just took the opportunity to call me names for being so pedantic ;)
Jonathan Sampson
+2  A: 

Kl? Try this...

CSS:

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

HTML:

<div id="testid"><span>test</span></div>
Mickel
You did not answer his question.
Jonathan Sampson
No Jonathan, I just suggested what could have been a SOLUTION for this given problem (if you'd ask me).
Mickel
@Mickel, it's alright to offer an alternative solution. But address his question in the process.
Jonathan Sampson
+4  A: 

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.

Zoidberg
+2  A: 

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

Jonathan Sampson
No need to copy others answers mate :) ;)
Dorjan
Didn't copy - you edited your answer, and we both landed on similar search results.
Jonathan Sampson
I know, hence the ;) Please remove your vote down on my post though!I just saw, you must've :) Thanks! Vote up for you for pointing out my overlooking of his question :)
Dorjan
Downvote replaced with an up-vote. Thank you for addressing his question ;) That behavior will make SO a better place ;)
Jonathan Sampson
Interesting, thanks :)
Litso