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
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.