Having a layout issue. I'm using Bootstrap for this project but not for the cards.
The project is available here: http://marcmurray.net/jay_test/#
The elements in the grid layout are all sized to the same height, but are not lining up on the same baseline. The cards with 2 lines seem to align higher up than ones with 1, but for the life of me I can't seem to figure out why. Not sure if I can link to a codepen as the cards are generated dynamically, but the CSS relating to them is here:
.mix {
width: 30%;
padding-top: 0.1em;
padding-bottom: 0.1em;
padding-left: 1em;
padding-right: 1em;
box-shadow: 2px 2px 2px #ddd;
display: inline-block;
margin-left: 1em;
}
.item {
text-align: center;
background-color: #fff;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-top: 30px;
line-height: 1.5em;
position: relative;
}
.item-bottom {
background-color: #f8f6f5;
width: 100%;
-webkit-transition: all .25s;
-moz-transition: all .25s;
-ms-transition: all .25s;
-o-transition: all .25s;
transition: all .25s;
background-color: #F8F6F5;
height: 2em;
position: absolute;
bottom: 0px;
left: 0;
}
Anyone have any ideas?
I opened your website, and opened developer tools and removed dispaly: inline-block;
from the element and it lined up nicely.
These probably shouldn't be inline-blocks. They're clearly block-level elements.
So: make them:
display: block;
float: left;
and they show up and sit properly.
Note: you have to remove the hard-coded styling of inline-block on the actual cards themselves or it will override what you're got.
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.