1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

spacing with css

Discussion in 'CSS' started by falco85, Nov 29, 2005.

  1. #1
    Hi,
    cannot manage to customs spacing with css :(
    for example, i'd like to set the spacing I want between the paragraphs or divs of my text, or the tables spacing. thank you
     
    falco85, Nov 29, 2005 IP
  2. web-spy

    web-spy Active Member

    Messages:
    127
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #2
    For paragraphs, you can assign margin to the p elements:

    p {
    margin-bottom: 10px;
    }
    Code (markup):
    This creates a space of 10px under every p element.
     
    web-spy, Nov 29, 2005 IP
  3. 2mk_atspace

    2mk_atspace Well-Known Member

    Messages:
    317
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #3
    You can Use :

    p {
    padding-bottom: 5px;
    }
     
    2mk_atspace, Dec 1, 2005 IP
  4. Shodan5

    Shodan5 Guest

    Messages:
    53
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Depends on what you are doing, if it's inside another div tag, use padding, if it's not us margin!
     
    Shodan5, Dec 5, 2005 IP
  5. someguy

    someguy Guest

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I alwas try to keep the margins around a div or p same, rather then setting individual margins,

    like this

    p {
    margin: 10px;
    }

    Otherwise I find you set the top bottom left and right differently and you can never get your page to balance up.

    Also look up the CSS box model that should shed some light on the subject.
     
    someguy, Dec 8, 2005 IP