Line up DIVs horizontally

Discussion in 'HTML' started by anf4u360@yahoo.com, Sep 16, 2005.

  1. Guest

    I want them to line up like they do with TD.

    I've got them all using this. Is this the correct way to do it?

    Also, I'm getting a double border where they meet up. I thought
    collapse was supposed to prevent that.

    ..testdiv {
    position: static;
    width: 1em;
    float: left;
    border: 1px solid black;
    border-collapse: collapse;
    }
     
    , Sep 16, 2005
    #1
    1. Advertisements

  2. Neredbojias Guest

    With neither quill nor qualm, quothed:

    > I want them to line up like they do with TD.


    I want them to line up like they do in the Army, but most women refuse.

    > I've got them all using this. Is this the correct way to do it?


    ??? Using what?

    > Also, I'm getting a double border where they meet up. I thought
    > collapse was supposed to prevent that.
    >
    > .testdiv {
    > position: static;
    > width: 1em;
    > float: left;
    > border: 1px solid black;
    > border-collapse: collapse;
    > }


    Oh, I see: it's a css question. Thought you were bonkers there for a
    moment, mate.

    Anyway, you are probably referring to collapsing margins not borders and
    the margins of floated boxes do not collapse. "Border-collapse" is for
    tables.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Sep 16, 2005
    #2
    1. Advertisements

  3. Guest

    in news::

    > I want them to line up like they do with TD.
    >
    > I've got them all using this. Is this the correct way to do it?
    >


    it sounds like your divs are wrapping? some of the "later" divs stack underneath "earlier" (earlier in your x/html file)?

    if so, you *may* have to attend to total widths.


    body padding:0.5%
    layout is
    [div, width 33%] [div, width 33%] [div, width 33%]
    that would be a tight fit, cause those widths add to 100%

    caveat: i've already forgotten what pos static does. (it didn't appeal to my intentions, only honorable, when i read about pos
    static) :)
     
    , Sep 16, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hugo
    Replies:
    10
    Views:
    1,633
    Matt Humphrey
    Oct 18, 2004
  2. shank

    line up images horizontally

    shank, Oct 1, 2003, in forum: HTML
    Replies:
    7
    Views:
    1,114
    brucie
    Oct 1, 2003
  3. rich
    Replies:
    0
    Views:
    921
  4. Daniel

    2 divs on same line

    Daniel, Jan 24, 2007, in forum: ASP .Net
    Replies:
    14
    Views:
    1,023
    Laurent Bugnion [MVP]
    Jan 24, 2007
  5. kaushikshome
    Replies:
    4
    Views:
    1,057
    kaushikshome
    Sep 10, 2006
  6. scad
    Replies:
    23
    Views:
    1,497
    Alf P. Steinbach
    May 17, 2009
  7. Marek Stepanek
    Replies:
    12
    Views:
    703
    Peter J. Holzer
    Sep 2, 2006
  8. maya
    Replies:
    4
    Views:
    496
Loading...