我正在尝试将图像模型转换为 HTML/CSS 并且我正在努力让事物正确定位 - 特别是垂直对齐,以及在调整窗口大小时让事物保持相对位置。
JSFiddle 代码:
http://jsfiddle.net/victorhooi/ZcrCc/
全屏 JSFiddle 输出:
http://jsfiddle.net/victorhooi/ZcrCc/embedded/result/
我有这个模型:
但是,如果您查看上面的 JSFiddle,我似乎无法获得打开和关闭分支,以及中心的类型图像在白框中垂直对齐 - 它们无处不在。
的HTML:
<section id="proposal" class="backgroundphotos">
<div class="row">
<div class="col-md-10 col-md-offset-1 panel panel-default">
<div class="row">
<div class="col-md-1 col-md-offset-2">
<img src="http://www.victorandalpha.com/images/curly_brackets_open.png" />
</div>
<div class="col-md-2">
<img src="http://www.victorandalpha.com/images/proposal_01.png" />
<img src="http://www.victorandalpha.com/images/proposal_02.png" />
<img src="http://www.victorandalpha.com/images/proposal_03.png" />
</div>
<div class="col-md-2">
<img src="http://www.victorandalpha.com/images/proposal_04.png" />
<img src="http://www.victorandalpha.com/images/proposal_05.png" />
<img src="http://www.victorandalpha.com/images/proposal_06.png" />
</div>
<div class="col-md-2">
<img src="http://www.victorandalpha.com/images/proposal_07.png" />
<img src="http://www.victorandalpha.com/images/proposal_08.png" />
<img src="http://www.victorandalpha.com/images/proposal_09.png" />
</div>
<div class="col-md-1">
<img src="http://www.victorandalpha.com/images/curly_brackets_close.png" />
</div>
</div>
</div>
</div>
</section>
使用 CSS:
.backgroundphotos {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-attachment: scroll; /* Why does this not carry over? */
min-height: 800px;
}
#proposal {
background: url(../img/04.jpg) no-repeat center center fixed;
background-attachment: scroll;
}
#proposal > div.row > div > div.row > div {
position: relative;
bottom: -90px;
}
#proposal > div.row {
position: relative;
bottom: -22.500em;
}
注意:我已经编辑了原始问题,将其拆分为其他 CSS 定位问题的单独问题。相关问题在这里: