I'm trying to align the layout so the images align in a row.
Here's a image of what it is currently doing
HTML
<div class="p-alignleft"></div>
<div class="p-alignright"></div>
CSS
.p-alignleft {
float: left;
margin-right:40px;
width:450px;
font-size: 1.2em;
line-height: 1.4em;
}
.p-alignright {
float: right;
width:450px;
font-size: 1.2em;
line-height: 1.4em;
}
If I understand rightly, you have a couple of options here. Instead of floating, my preference is to set each div to display: inline-block; That will make the divs line up next to each other, even if one is taller than the other:
A working example: http://cdpn.io/ojDEl
By looking at the captured screen, I think you should enclose each person's part inside a
div
, and give them classes.p-alignleft
or.p-alignright
. After every two of them, make an empty<div class="clear"></div>
with style.clear {clear:both}
, so the next two persons will align at the same vertical levelHTML:
CSS:
<div class="row clearfix"><div class="media">...</div></div>
clear: left
on the odd ones.something like this, you probably need to tweak it, it's more like pseudo code.: