【发布时间】:2013-07-15 14:57:48
【问题描述】:
我正在创建一个简单的房地产网站,目前正在创建列表页面。我想要一个与here 非常相似的产品。我无法从代码中获得灵感,因为我使用的是skeleton framework。这是我的current progress and code 或以下。
这两个元素;财产照片和正文分开(中间有一个间隙)。
而且,如果您调整浏览器的大小,列表不会呈现为应有的垂直矩形。
我的原始问题是:
1) 我如何连接图片和正文,这样中间就没有空格了?
2) 当正文需要在照片下方折叠时,如何使正文和图像宽度相同? (调整浏览器或设备大小时)
HTML
<div class="five columns image">
<a href="Properties/9-Walter-Street-Claremont/Walter-Street.html"><img src="Properties/9-Walter-Street-Claremont/Listing.jpg" alt="Listing"></a>
</div>
<div class="ten columns body-info">
<h2><a href="Properties/9-Walter-Street-Claremont/Walter-Street.html">Walter Street <span>$2500/wk</span></a></h2>
<h3>Claremont, 6010</h3>
<p>Lorem Ipsum</p>
<div class="info">
<ul>
<li><img src="img/bedrooms.png"> 5</li>
<li><img src="img/bathrooms.png"> 3</li>
</ul>
</div>
</div>
CSS
.body-info {
background-color: #fff;
height: 200px;
-webkit-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);
-moz-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);
box-shadow: 0px 1px 1px rgba(0,0,0,0.1);
margin-bottom: 30px;
padding: 0px;
}
.image a img:hover {
background-color: rgba(0,0,0,0.5);
background-image: url("img/eye.png");
background-position: center center;
background-repeat: no-repeat;
}
.body-info h2 a {
transition: color 0.2s ease-in;
-webkit-transition: color 0.2s ease-in;
color: #428f9c;
font-size: 23px;
font-weight: normal;
}
.image {
width: 270px;
float: left;
}
.body-info {
margin-left: 280px;
}
.body-info h2 a:hover {
color: #0b7587;
}
.body-info span {
margin-right: 15px;
color: #444;
}
.body-info p {
color: #777;
font-size: 16px;
}
.body-info ul {
list-style: none;
}
.body-info ul li {
color: #777;
}
提前谢谢你!
【问题讨论】: