centering your middle div (column)

Discussion in 'CSS' started by mnymkr, Apr 24, 2006.

  1. #1
    I am building a site where it looks the best if i float the left column left and the right column right but then that leaves my middle column uncentered. any ideas on how to center the middle column between the two?
     
    mnymkr, Apr 24, 2006 IP
  2. jrd1mra

    jrd1mra Peon

    Messages:
    243
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    fixing the widths of the left and right divs and setting the width of the middle div to auto may help. Got a URL? I can be of more help if I can see it.
     
    jrd1mra, Apr 24, 2006 IP
  3. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #3
    Margins and set the widths of the left and right divs.

    Like the holy grail layout does.
     
    johneva, Apr 24, 2006 IP
  4. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #4
    here is the url....i am moving a phpnuke them over to joomla for my clan site.....just a couple of minor things left to do...here i have the columns fixed and the middle area set to width auto......



    also if youdont mind.... the first block in the left column i cant get the bottom padding to go away....

    also the small pic under the window is larger than the specified 7px. anyways...thanks
     
    mnymkr, Apr 24, 2006 IP
  5. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #5
    i looked at the float tutorial example....i am trying to understand here so that is why i dont just copy it ...what does setting the margins to 200 do? will auto work here the same?
     
    mnymkr, Apr 24, 2006 IP
  6. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #6
    Setting the margin to 200px centers it as the two margins force it to only be whats left between the two margins of 200px.

    You would just adjust the margins to fit in with the size of the left and right div.

    Not sure about auto I have never tryed it though I doubt it would work or they would have done that with the holy grail layout as it is a very well know layout and was not built by somebody who dont know what there doing (Like me).
     
    johneva, Apr 24, 2006 IP