Can you specify the size of a division (<div></div>) using CSS even if it's really...

Discussion in 'CSS' started by cre8ive, Jan 22, 2008.

  1. #1
    I have the following divisions:
    <div style="position: absolute; top: 20px; left: 183px; height: 5px; width: 6px; background: #3A3A3A; background: #3A3A3A url('images/navshadowright.jpg.jpg') no-repeat; z-index: 99;">
    </div>
    
    Code (markup):
    <div style="position: absolute; top: 20px; left: 167px; height: 13px; width: 16px; background: #3A3A3A url('images/navshadow.jpg') no-repeat; z-index: 100;">
    </div>
    
    Code (markup):
    This seems to work fine in Firefox, but it seems that IE takes up more spaces than ones specified. My question is this.

    q1. Can you specify the size of a division (<div></div>) using CSS even if it's really small?

    q2. If so, how?

    q3. What am I doing wrong in my code?
     
    cre8ive, Jan 22, 2008 IP
  2. scubita

    scubita Peon

    Messages:
    5,550
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #2
    can you provide a live link for this one?

    what exactly is your problem?
     
    scubita, Jan 23, 2008 IP
  3. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think IE6 has a minimum of something like 18 pixels. I have had this problem too. The solution, which is kind of fun, is to make the div above it have a 5px border. IE reads borders fine for small heights, or even HR tags which you can edit. However, with divs for some reason it has issues.

    Hope this helps.
     
    LeetPCUser, Jan 23, 2008 IP
  4. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #4
    soulscratch, Jan 23, 2008 IP
  5. cre8ive

    cre8ive Peon

    Messages:
    295
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    For the purpose of clarification ...

    Having the following ...

    font-size: 1px;
    line-height: 1px;

    ... solves this problem.

    Thanks for the great help, everyone ...
     
    cre8ive, Jan 29, 2008 IP