PrateekSaxena Posted February 19, 2007 Share Posted February 19, 2007 Hello,I am trying to make a <DIV> with both height and width of 1px and color blue but I am not able to do so. could some one please give me a code so that I can make such a DIV? Link to comment Share on other sites More sharing options...
jesh Posted February 19, 2007 Share Posted February 19, 2007 You might try this: <div style="width: 1px; height: 1px; overflow: hidden; background-color: blue;"></div> The overflow: hidden; was added to appease IE6. Link to comment Share on other sites More sharing options...
croatiankid Posted February 19, 2007 Share Posted February 19, 2007 IE doesn't like elements with dimensions smaller than the font size, so either setting the font size to 1px (idk if 0 is valid), or line-height, or overflow:hidden should work. Link to comment Share on other sites More sharing options...
PrateekSaxena Posted February 20, 2007 Author Share Posted February 20, 2007 Thank you so much Jesh, it worked perfectly both on FF 2.0 and IE 6.0I was missing out on overflow Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now