-
AuthorPosts
-
March 1st, 2013 at 15:57 #3953Juliet
Hello,
I want to put images side by side, on 2 lines. Like this :
Img Img Img Img
Img Img Img Img
As I need to have a link to another page when I click on them, I put this code (twice):
<div id=”imgacc”>
<img class=”imgacc” src=”http://localhost/copie/wp-content/uploads/2013/02/225.jpg” alt=”” />
<img class=”imgacc” src=”http://localhost/copie/wp-content/uploads/2013/02/225.jpg” alt=”” />
<img class=”imgacc” src=”http://localhost/copie/wp-content/uploads/2013/02/225.jpg” alt=”” />
<img class=”imgacc” src=”http://localhost/copie/wp-content/uploads/2013/02/225.jpg” alt=”” />
</div>and in the style sheet :
.imgacc {
float:left;
margin-left:10px;
padding:0;
width: 225px;
height: 225px;
}The problem is :
– the margin doesn’t change, they are one against the other
– One the second line they are on the same line but on the first they are liek stairs (the 2d img is a little lower than the first, 3d a little lower again, etc)
Do you know where it comes from?
Why they are not aligned? Why the margin doesn’t work?
My theme is Mantra, didn’t change anything else.
Thanks a lot for your help and reply!
March 8th, 2013 at 21:38 #4139KayCryout Creations mastermindThis is not theme related. This is pure HTML/CSS.
Try adding display:block to your CSS code so it looks like this
.imgacc {
float:left;
margin-left:10px;
padding:0;
width: 225px;
height: 225px;
}
Before posting consider reading our short theme debugging instructions.
Please read the FAQs: Mantra • Nirvana • Parabola • Tempera
Tutorials: custom menus • translating theme • installing theme • category page with intro • disabling comments Wordpress: child themes • categories/posts
Before making any modifications to your theme we strongly recommend using Child Themes. -
AuthorPosts
The topic ‘Add images side by side’ is closed to new replies.