WEB CSS line-height attribute

Discussion in 'OT Technology' started by ralyks, Nov 20, 2008.

  1. ralyks

    ralyks New Member

    Joined:
    Feb 22, 2005
    Messages:
    6,796
    Likes Received:
    1
    Code:
    <div style="display:block;width:25%;float:left;line-height:140%;"></div>
    Anyone know why this isn't display lines 140% larger than normal (using FF)?
    Or why float:right doesn't display the other div next to a float:left in IE?
     
  2. pkr

    pkr Guest

    Use em instead of %
     
  3. pkr

    pkr Guest

    Or you can use px
     
  4. ralyks

    ralyks New Member

    Joined:
    Feb 22, 2005
    Messages:
    6,796
    Likes Received:
    1
    That worked.
    http://www.w3schools.com/css/pr_dim_line-height.asp
    shows % and 1.x as valid however, are they deprecated?

    Next question: Are float:left and float:right not supported in IE? How should it be done so that they line up?
     
  5. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    Try setting both the float:left
     
  6. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF
    divs already display as block.
     
  7. ralyks

    ralyks New Member

    Joined:
    Feb 22, 2005
    Messages:
    6,796
    Likes Received:
    1
    Did some more searching around on my own.
    This fixed part of it. You also need to add "display:inline" for IE.

    So the code went from:
    Code:
    <div style="display:block;width:25%;float:left;line-height:1.7em;">...</div>
    <div style="display:block;width:75%;float:right;">...</div>
    to
    Code:
    <div style="width:25%;float:left;line-height:1.7em;">...</div>
    <div style="float:left;display:inline;">...</div>
    It displays exactly the same in FF, however it also works in IE.

    Notes: display:block isn't needed with a float, as float automatically makes it a block.

    edit: left the window open for a shower,
    ah.
     
  8. ralyks

    ralyks New Member

    Joined:
    Feb 22, 2005
    Messages:
    6,796
    Likes Received:
    1
  9. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF

Share This Page