Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    84
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Pushing two divs together

    Normally there is a little space in between two divs; in order to make them touch I simply do a negative top margin (which does what I need), but I'm curious if there is a simple property I can include that will do it by default?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Add
    Code:
    *{
    margin:0;padding:0;
    }
    to your css and then have a look
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Apr 2012
    Posts
    84
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    Add
    Code:
    *{
    margin:0;padding:0;
    }
    to your css and then have a look
    Still leaves the space. Not important, I think a negative margin is the only way to accomplish it, and it works fine.

  • #4
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    That CSS that abduraooft posted would get rid of any default margin and padding for all elements.

    Why not post your code and highlight what you're refering to!?


  •  

    Posting Permissions

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