Results 1 to 3 of 3

Thread: Float and margin: 0 auto...

  1. #1
    Join Date
    Nov 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Float and margin: 0 auto...

    I am editing a template here. Basically the articles should be vertically aligned to the header elements... The header elements are centered with the "margin: 0 auto" property/values. I am trying to do the same with the div containing the articles but to no avail, as the div itself is floating left...

    Thank you very much for your suggestions...
    Last edited by Mad_Griffith; 06-27-2012 at 05:27 PM.

  2. #2
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Are you trying to get two or more things on the same line? (Hence the float:left;)
    An alternitive to float:left; that allows multiple divs on the same line and centering them is display:inline-block;

    Try it out...

  3. #3
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by keyboard1333 View Post
    Are you trying to get two or more things on the same line? (Hence the float:left;)
    An alternitive to float:left; that allows multiple divs on the same line and centering them is display:inline-block;

    Try it out...
    Just expanding on what keyboard said, float left actually takes things out of the flow of the page, therefore allowing them to be next to each other.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •