Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2005
    Posts
    124
    Thanks
    7
    Thanked 0 Times in 0 Posts

    ie and small divs with background colors

    So i've come across a very strange bug with ie. i'm trying to simpley make a box with css and color the background. here's some sample code:

    PHP Code:
    <style type="text/css" media="screen">
        .
    poo{
            
    height5px
            
    width20px
            
    line-height0;
            
            
    backgroundblue
            
    border1px solid red;
        }
    </
    style>

    <
    div class=poo> </div>
    <
    br>
    <
    div class=poo>  asdfasdfasdf </div
    i just want the box with no content to be 5px high, and 20px wide.

    the first div that doesn't have any content is the right width, but the height is more than 5px for some reason. I tried using line-height to fix that, but line-height only works when there is content in the div.

    the 2nd div that has content in it is the right height, but not the right width. it stretches horizontally to accommodate the content. the line-height: 0 makes it so the div doesn't stretch vertically to fit the content.

    also, if you size the div to anything above about 20px for the width and height, it seems to render fine. that's why i though the line-height might be the issue, but apparently it's not.

    any ideas??

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Tried tying font-size down a notch too? =)

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Posts
    124
    Thanks
    7
    Thanked 0 Times in 0 Posts
    amazing. that worked.

    thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •