私はいくつかの数字を中心にしようとしています。現時点で2桁ですが、3桁以内でお願いします。しかし、幅を広げようとするたびに、すべての図がおかしくなるか、わずかに左に移動します。どんな助けでも親切にいただければ幸いです。次の視覚資料: http://jsfiddle.net/QcLLC/
HTML:
<section class="main">
<div class="grid clearfix masonry" id="grid" style="position: relative; height: 1820px;">
<figure style="position: absolute; top: 0px; left: 0px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/4.jpg"><figcaption style="position: absolute; width: 100%;"><a href="http://drbl.in/fWMT">Fall 7 Times Stand Up 8</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 0px; left: 416.34375px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/7.jpg"><figcaption><a href="http://drbl.in/fLBG">Unashamed Optimism of Ambition</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 260px; left: 416.34375px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/1.jpg"><figcaption style="position: absolute; width: 100%;"><a href="http://drbl.in/fWMM">Stay Hungry. Stay Foolish.</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 650px; left: 0px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/3.jpg"><figcaption><a href="http://drbl.in/fWPV">Wild Hearts Cannot Be Tamed</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 910px; left: 0px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/5.jpg"><figcaption><a href="http://drbl.in/fGhI">2012 Detroit Tigers</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 910px; left: 416.34375px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/6.jpg"><figcaption><a href="http://drbl.in/fKCf">Bad Hair Day</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 1170px; left: 0px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/2.jpg"><figcaption><a href="http://drbl.in/fQdt">Work Hard. Stay Humble.</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 1170px; left: 416.34375px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/8.jpg"><figcaption><a href="http://drbl.in/fPEY">Everyone Deserves To Be Adored</a> by Erika Mackley</figcaption></figure>
<figure style="position: absolute; top: 1430px; left: 0px;" class="masonry-brick"><img src="http://tympanus.net/Development/StickyCaptionsConcept/images/9.jpg"><figcaption><a href="http://drbl.in/fWwG">Sarah William's Quote</a> by Erika Mackley</figcaption></figure>
</div>
</section>
</div><!-- /container -->
CSS:
.grid {
margin: 30px auto;
}
.grid figure {
display: block;
float: left;
margin: 0 1% 10px 1%;
cursor: pointer;
overflow: hidden;
}
.grid figure img {
display: block;
}
.grid figure figcaption {
position: absolute;
font-size: 16px;
font-weight: 400;
left: auto;
width: 100%;
height: 60px;
bottom: -60px;
padding: 20px;
color: #ddd;
background: #18bcbc;
-webkit-font-smoothing: antialiased;
-webkit-transition: bottom 0.2s ease;
-moz-transition: bottom 0.2s ease-in-out;
-ms-transition: bottom 0.2s ease-in-out;
-o-transition: bottom 0.2s ease-in-out;
transition: bottom 0.2s ease-in-out;
}
.grid figure figcaption a {
color: #fff;
}
.grid figure figcaption a:hover {
color: #ffd468;
}
.grid figure:hover figcaption {
bottom: 0px;
}
html { height: 100%; }
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
margin: 0;
}
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
body {
background: #ffe19a url(../images/noisebg.png);
font-weight: 300;
font-size: 14px;
color: #333;
overflow: scroll;
overflow-x: hidden;
}
a {
color: #555;
text-decoration: none;
}
.container {
width: 100%;
position: relative;
}
.main,
.container {
width: 100%;
max-width: 1275px;
margin: 0 auto;
position: relative;
padding: 0 0 5px 0px
}