我说要学习响应式设计,但到目前为止,我似乎无法弄清楚一件事......
这是一个工作示例:http ://ericbrockmanwebsites.com/dev1/
我希望其中包含文本的 div 元素 (contactBg) 下降到左侧图像的底部。显然,我可以通过以 px 为单位定义高度来做到这一点,但是当窗口的其余部分调整大小而不是流动时,该高度将保持不变。
如果那里有任何好的文章,您可能知道解释如何做到这一点,那将非常有帮助,谢谢!
这是标记:
<div class="row-fluid">
<div class="span10 offset1">
<div class="container-fluid">
<div class="row-fluid">
<div class="span5">
<img src="images/logo.jpg" alt="logo" />
<img src="images/store.jpg" alt="store" />
</div><!-- /span5 -->
<div class="span7">
<img src="images/portal.jpg" alt="portal">
<div class="contactBg">
Administration: Emma Jane Julien<br />
<a href="mailto:ej@emmajulien.com">ej@emmajulien.com</a>
</div><!-- /contactBg -->
</div><!-- /span7 -->
</div><!-- /row-fluid -->
</div><!-- /container-fluid -->
</div><!-- /span10 offset1 -->
</div> <!-- /row-fluid -->
这是CSS:
body {
background: url(../images/3D2A1698A177AF9B71_218.png) repeat;
}
img {
max-width:100%;
padding-bottom:1%;
}
.container-fluid {
background:#fff;
padding: 1%;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid [class*="span"] {
display: block;
float: left;
width: 100%;
min-height: 30px;
margin-left: 1%;
*margin-left: 2.709239449864817%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.row-fluid .span10 {
width: 82.87292817679558%;
*width: 82.81973668743387%;
}
.row-fluid .span7 {
width: 58.06353591160195%;
*width: 57.12912895262725%;
}
.row-fluid .span5 {
width: 40.93646408839753%;
*width: 40.00205712942283%;
}
.row-fluid .span4 {
width: 31.491712707182323%;
*width: 31.43852121782062%;
}
.contactBg {
background: #282624;
padding: 3%;
max-width:100%;
height:auto;
}