Reputation: 11
How do I align my pictures perfectly I've got them next to each other but ones slightly lower than the other and I can't get them on the same line. Is there anyway apart from position relative that I can use?
Here is my code:
#newRelises{
width:650px;
float:left;
margin-left:15px;
margin-top:5px;
}
#newRelises img{
width:170px;
height:170px;
float:left;
display:inline;
margin-left:15px;
margin-bottom:15px;
}
Upvotes: 0
Views: 104
Reputation: 1
You may add "overflow:hidden;" . SO your final code will be like this:
#newRelises{
width:650px;
float:left;
margin:5px 0 0 15px;
overflow:hidden;
}
#newRelises img{
width:170px;
height:170px;
float:left;
display:block;
padding:0;
margin:0 0 15px 15px;
}
Upvotes: 0
Reputation: 605
Try this on both images.
img {display:inline-block;}
Update: And I see @adaam already posted a fiddle as a comment, so I am going to copy it down here since it's the same solution:
http://jsfiddle.net/elvista/cKePX/2/
Upvotes: 1
Reputation: 1220
Try this:
float:left
from #newRelises
and #newRelises img
display:inline
to display:inline-block
text-align:center
to #newRelises
Upvotes: 1