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.

Align images horizontally in a div - Need a Help

Discussion in 'HTML & Website Design' started by AimyThomas, Aug 9, 2012.

  1. #1
    I have a static website and want to add social media link buttons like twitter, facebook and likedin and all buttons should be display horizontally but the problem was that when I put first button its look well as per my program but when I place the second button within the div it puts itself under the first button, in its place of to the right of the first button I try lots but still its not working
    Help me

    Thanks in AdvanceI have a static website and want to add social media link buttons like twitter, facebook and likedin and all buttons should be display horizontally but the problem was that when I put first button its look well as per my program but when I place the second button within the div it puts itself under the first button, in its place of to the right of the first button I try lots but still its not working
    Help me

    Thanks in Advance
     
    AimyThomas, Aug 9, 2012 IP
  2. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #2
    Can you provide the HTML and CSS code? Otherwise it's just guessing.
     
    GMF, Aug 9, 2012 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #3
    What GMF said, no code becomes a case of "this is why we can't help you"

    Though centering an image you have three options:
    1) text-align:center on it's parent -- difficult to use if there's other content inside it's parent.

    2) apply the image as a css background, use background-position to center it. Difficult if the image is in fact content, and belongs in the markup.

    3) set the img to display:block and margin:0 auto;

    I do end up with a question though, what do they need a div around them for? Are you talking a div around each image, or a div around all three images... what other elements is it interacting with in flow?

    Again, why we need to see the code.
     
    deathshadow, Aug 9, 2012 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    Is each button in a separate div? (Just guessing here.) Divs are block elements - each one will start on a new line.
     
    Rukbat, Aug 11, 2012 IP
  5. lazyspider

    lazyspider Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    give the all divs a common class name and then in your css stylesheet add these lines:
    .className
    {
    display:inline-block;
    }
    hope it will work.
     
    lazyspider, Aug 13, 2012 IP