【发布时间】:2017-01-14 11:29:18
【问题描述】:
我正在制作一个网页,我想让 2 个图像缩略图以相同的高度彼此相邻。 考虑我的 html 代码:
<div class="row">
<div class="col-md-6">
<img src="http://i.imgur.com/Ym35iJI.jpg" alt="frontend" class="img-thumbnail" width="640px" height="480px">
</div>
<div class="col-md-6">
<img src="http://i.imgur.com/ot6RubY.jpg" alt="webd" class="img-thumbnail" width="640px" height="480px">
</div>
</div>
对应于它显示的输出中的给定代码(这只是输出的裁剪图像):
我不明白为什么 height 属性没有为两个图像分配相同的高度
这里的答案之一是css文件:
body{
background-color: rgb(45,45,45);
}
.page-header{
height: 100px;
background-color: rgb(17, 17, 17);
margin-top: 0px;
margin-bottom: 0px;
}
#title{
font-size:400%;
color: white;
font-family: 'Oswald', sans-serif;
}
.nav-button{
margin-top:24px;
margin-right:50px;
margin-left:50px;
width:110px;
height:55px;
}
.btn h3{
margin: 0 auto;
font-family: 'Cabin', sans-serif;
}
.about{
background-color: rgb(175, 187, 206);
height:300px;
font-size:16px;
}
.container{
margin-top:0px;
}
.body-text{
font-family:'Cabin', sans-serif;
padding-top:60px;
padding-left:25px;
font-size:175%;
}
.my-image{
height:280px;
width:270px;
padding-top:20px;
padding-right:30px;
}
.portfolio{
height: 1200px;
}
#portfolio-heading{
padding-top: 30px;
color: rgb(255,255,255);
}
【问题讨论】:
-
只是我看到你覆盖了 CSS 中的图像高度。如果您将宽度/高度设置为样式游览 img 标签,就可以了! `
标签: html css twitter-bootstrap frontend