Jump to content

Changing the style if the browser is IE


lAZLf

Recommended Posts

So for my website I have one style attribute for a div that changes whether or not the user is using ie or something else

#dropdown {
display:inline-block;
margin:0px;
width:110px;
*display: inline;
}

 

the * means it will only work in ie. So that fine, but now i need to be able to do that, change it if its in ie, through javascript.

how would i do that?

 

something like this?

document.getElementByID(id).style.XXXXXXXXXXXXXXXX?

Link to comment
https://forums.phpfreaks.com/topic/200695-changing-the-style-if-the-browser-is-ie/
Share on other sites

Why do you have to do this with JavaScript?

 

Why not use the IE comment-hacks to include a small CSS file with changes for IE?

 

Or why not define a special class in your CSS with these attributes and just add or remove the class to the div element with JavaScript?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.