我想弄清楚如何編寫我的HTML & CSS以使3張截圖圖像對齊,如下面的截圖所示。響應對齊,浮動和居中圖像
這個想法是,當用戶調整窗口的大小時,左右圖像應朝中心移動,或者在主圖像後面更緊,主圖像始終保持居中。
我的開發鏈接: http://leongaban.com/portfolio/athenasweb/
我CodePen http://codepen.io/leongaban/pen/AwJFt
和提示,或者方向將是超級感謝! :d
HTML
<div class="pattern">
<div class="athena_thumbs">
<div class="first">
<img src="../../images/athena1.jpg"/>
</div>
<div class="second">
<img src="../../images/athena2.jpg"/>
</div>
<div class="third">
<img src="../../images/athena3.jpg"/>
</div>
</div>
</div>
CSS
div.inner .pattern {
position: absolute;
width: 100%;
height: 100%;
background-image:url('http://leongaban.com/images/pattern_diagonal_lines.png');
background-repeat: repeat;
z-index:2;
}
.athena_thumbs {
position: absolute;
max-width: 1000px;
margin: 250px auto 0;
}
.athena_thumbs .first {
position: relative;
margin: 0 auto;
float: left;
left: 25%;
right: 25%;
z-index: 3;
}
.athena_thumbs .second {
position: relative;
float: left;
left: 10%;
right: 5%;
z-index: 2;
}
.athena_thumbs .third {
position: relative;
float: left;
right: 10%;
left: 5%;
z-index: 1;
}
您好,謝謝! :D – 2013-03-10 22:23:12