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.

I need to center this, How can I do it.

Discussion in 'CSS' started by cowsgonemadd3, Jan 27, 2010.

  1. #1
    I want to center where the text block is but I do not know how. Here is the code if anyone can help. Thanks

    /* Content */
    #content {width:540px;float:left;background-color:#FFFFFF;margin-top:-5px;padding-top:10px}
    #content p {color:#4B4B4B;font-size:12px;padding:10 5px 0px 5px}

    Telling it to float "center" or "middle" does nothing.
     
    cowsgonemadd3, Jan 27, 2010 IP
  2. EatingEmoKids

    EatingEmoKids Member

    Messages:
    111
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #2
    set the margin-left and margin-right to auto. That should center it.
     
    EatingEmoKids, Jan 27, 2010 IP
  3. FoxyGamers

    FoxyGamers Active Member

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    78
    Digital Goods:
    1
    #3
    Try adding what i have lebelled in bold to both of them. It should work.
     
    FoxyGamers, Jan 27, 2010 IP
  4. unigogo

    unigogo Peon

    Messages:
    286
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    {margin-left: auto;
    margin-right: auto;
    }

    will not work when the div is floated. Remove {float:left}
     
    unigogo, Jan 28, 2010 IP
    Stomme poes likes this.