Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE if clause not working? 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hello,

Can someone tell me why this isn't working..
Code:
<style type="text/css">
        .selwid {
            width:123px;
            }
            
        <!--[if IE]>
        .selwid {
            width:143px;
            }         
        <![endif]-->
</style>

is the syntax wrong or something?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Hi

You can put the conditional comments only where HTML comments are valid. So move it out from the [tt]style[/tt] :
Code:
<style type="text/css">
        .selwid {
            width:123px;
            }
</style> 

<!--[if IE]>
<style type="text/css">
        .selwid {
            width:143px;
            }         
</style> 
<![endif]-->

Feherke.
 
lol I was just coming back to say , worked it out, it was syntax!

can't put the condition within a tag must be parent node!

and you beat me to it!

nice one Feherke

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top