width property

Discussion in 'CSS' started by jollyjack, Nov 11, 2007.

  1. #1
    I have some hyperlinks formatted to show a border, background color, etc.

    I also have their width set to about 130px, but it doesn't show up unless I use display:block. But I want them to show in a row, and display:block puts them on a line each.

    How can I get the width property to dhow without using display:width?

    Many thanks.

    Jack
     
    jollyjack, Nov 11, 2007 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Float them ( float:left; is probably what you need ), and they will shrinkwrap ( contain whatever you have in there ) and as long as there's enough space in the container, they will show up horizontally without any breaks between. You should also clear your float afterwards ( clear:left; ), so the element coming directly after your floats will not sit in the same row provided there's enough space.
     
    soulscratch, Nov 11, 2007 IP
  3. anions

    anions Notable Member

    Messages:
    4,840
    Likes Received:
    179
    Best Answers:
    0
    Trophy Points:
    275
    #3
    Have you tried display: inline. Maybe you coudl give us a link/code to work with.
     
    anions, Nov 13, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    No, that won't work. The inline and block-level box models are totally different from one another. In this case, the anchors need to be floated as soulscratch said.
     
    Dan Schulz, Nov 13, 2007 IP