I use this code:
.photocontents {
position: relative;
display: inline-block;
padding: 20px;
margin: 0px;
width: 100%;
height: auto;
}
.photo {
position: relative;
float: left;
display: inline;
padding: 0px;
margin: 10px;
width: auto;
height: auto;
}
to make a photo gallery that has the result of image (a).
What I want is to align those photos at top too, as image (b) shows. How is that possible?
It's not possible with pure CSS. You have to use some Javascript.
These jQuery plugins are doing exactly what you're looking for:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.