Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to align two boxes next to each other

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244318
    johned
    Participant

    I have two boxes and each box has a further two boxes and a image in them. My problem is I am trying to align them both next to one another but one of the main boxes (whitebox) is always higher than the other.
    I also find if I move one of the images or blue boxes up or down the other one also moves with it. How does this work as I have labeled them different names?
    I have attached my code below
    http://codepen.io/Johned22/pen/vKzAyd
    thanks in advance

    #244320
    Paulie_D
    Member

    You codepen does not seem to reflect the HTML structure you indicated…

    You seem to be using a lot of margin which is generally a warning sign..also a lot of your code is unnecessarily repetetive

    http://codepen.io/Johned22/pen/vKzAyd

    #244330
    johned
    Participant

    Thanks for your reply. Is this code a little better? http://codepen.io/Johned22/pen/vKzAyd
    How do I align more than two images next to one another as I find after the second image the third image appears under the first two rather than next to them?
    Thanks in advance

    #244332
    Paulie_D
    Member

    You need to create a Codepen with the actual HTML including the container div and associated CSS.

    EDIT:

    Seems I linked the wrong Codepen before

    http://codepen.io/Paulie-D/pen/ZOmBOd

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.