Jump to content

Problem with DIV Tag


sanyasirao

Recommended Posts

Hi I am struggling with some problem related to DIV tag.I have written the following lines of code if(browsername=="Microsoft Internet Explorer") { document.write("<div class=\"answersHome_divTag\" id=\"tableContainer\" style=\"OVERFLOW:scroll; width:100%; height: 150px;\">"); } else { document.write("<div class=\"answersHome_divTag\" id=\"tableContainer\" style=\"width:99%; height: auto;\">"); } It's working fine if I run this code on any browser except IE 7.0.It provides some unnecessary space when I run it on IE 7.0.How can I avoid this space?Please suggest me.Urgent.

Link to comment
Share on other sites

instead of javascript you could use conditional comments which will let you target exactly which version of IE you want (in your case not version 7)<!--[if lt IE 6]>Internet Explorer 6 & lower versions<![endif]--><!--[if gt IE 7]>Internet Explorer 7 & later versions<![endif]-->

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...