我正在使用我相当陌生的singularity.gs 建立一个网站。我无法为 div 提供背景颜色,这是我的 html 结构:
http://oi44.tinypic.com/205xt1i.jpg,“绿色”部分是我的关于 div。
<div class="about">
<div class="photo">
<img class="photoBorder" src="images/foto_jeroen.png" alt=""/>
</div>
<div class="text">
<h1>Hello I'm Jeroen Druwé</h1>
<p>...</p>
</div>
</div>
为了达到这种效果,必须为 div 设置一个高度:
@include breakpoint(70em) {
.about {
height: 340px; //This property will set the height of the div
}
.about .photo {
padding: 1em;
@include grid-span(2, 4);
}
.about .text {
padding-top: 7em;
padding-left: 1em;
display: inline;
@include grid-span(4, 6);
}}
如果我删除“height:340px”,则不会绘制背景:
http://oi39.tinypic.com/2s16ezl.jpg(只有我的细边界)
有没有办法让 div 围绕其内容(.photo,.text)包裹它的高度?
注意:如果我删除 .photo 和 .text 的 @include grid-span 会显示背景,但我不想失去奇点功能
提前致谢!