Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Imhaving a bit of difficulty with CSS styling on my website, Currently I have a row of images that I'd like to align horizontally along my page. But just now it displays them all vertically in a row and I'm not sure why. All the images are stored in an array, it's just getting them lined up that's the problem. here is my code:

   .img{
float:left;
width:120px;
margin:auto;
margin-left:10px;
padding:5px;
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
141 views
Welcome To Ask or Share your Answers For Others

1 Answer

You should add the to your style display:inline-block. The inline-block value makes, that your .img is not displayed with a new-line at the end.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...