我想讓高度爲100%的那一排。但是,該行不能以100%的高度完成(僅適用於固定高度像素)。我怎麼能使這一行適合100%? (因爲我想讓word_container在100%行的高度垂直和水平居中)。CSS連續100%的高度
/* Grid */
.row {
border-bottom: solid 1px transparent;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.row > * {
float: left;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.row:after, .row:before {
content: '';
display: block;
clear: both;
height: 0;
}
.row.uniform > * > :first-child {
margin-top: 0;
}
.row.uniform > * > :last-child {
margin-bottom: 0;
}
.row.\30 \25 > * {
padding: 0 0 0 0px;
}
.row.\30 \25 {
margin: 0 0 -1px 0px;
}
.row.uniform.\30 \25 > * {
padding: 0px 0 0 0px;
}
.row.uniform.\30 \25 {
margin: 0px 0 -1px 0px;
}
.row > * {
padding: 0 0 0 40px;
}
.row {
margin: 0 0 -1px -40px;
}
.row.uniform > * {
padding: 40px 0 0 40px;
}
.row.uniform {
margin: -40px 0 -1px -40px;
}
.row.\32 00\25 > * {
padding: 0 0 0 80px;
}
.row.\32 00\25 {
margin: 0 0 -1px -80px;
}
.row.uniform.\32 00\25 > * {
padding: 80px 0 0 80px;
}
.row.uniform.\32 00\25 {
margin: -80px 0 -1px -80px;
}
.row.\31 50\25 > * {
padding: 0 0 0 60px;
}
.row.\31 50\25 {
margin: 0 0 -1px -60px;
}
.row.uniform.\31 50\25 > * {
padding: 60px 0 0 60px;
}
.row.uniform.\31 50\25 {
margin: -60px 0 -1px -60px;
}
.row.\35 0\25 > * {
padding: 0 0 0 20px;
}
.row.\35 0\25 {
margin: 0 0 -1px -20px;
}
.row.uniform.\35 0\25 > * {
padding: 20px 0 0 20px;
}
.row.uniform.\35 0\25 {
margin: -20px 0 -1px -20px;
}
.row.\32 5\25 > * {
padding: 0 0 0 10px;
}
.row.\32 5\25 {
margin: 0 0 -1px -10px;
}
.row.uniform.\32 5\25 > * {
padding: 10px 0 0 10px;
}
.row.uniform.\32 5\25 {
margin: -10px 0 -1px -10px;
}
.\31 2u, .\31 2u\24 {
width: 100%;
clear: none;
margin-left: 0;
}
.\31 1u, .\31 1u\24 {
width: 91.6666666667%;
clear: none;
margin-left: 0;
}
.\31 0u, .\31 0u\24 {
width: 83.3333333333%;
clear: none;
margin-left: 0;
}
.\39 u, .\39 u\24 {
width: 75%;
clear: none;
margin-left: 0;
}
.\38 u, .\38 u\24 {
width: 66.6666666667%;
clear: none;
margin-left: 0;
}
.\37 u, .\37 u\24 {
width: 58.3333333333%;
clear: none;
margin-left: 0;
}
.\36 u, .\36 u\24 {
width: 50%;
clear: none;
margin-left: 0;
}
.\35 u, .\35 u\24 {
width: 41.6666666667%;
clear: none;
margin-left: 0;
}
.\34 u, .\34 u\24 {
width: 33.3333333333%;
clear: none;
margin-left: 0;
}
.\33 u, .\33 u\24 {
width: 25%;
clear: none;
margin-left: 0;
}
.\32 u, .\32 u\24 {
width: 20%;
clear: none;
margin-left: 0;
}
.\31 u, .\31 u\24 {
width:14.28%;
clear: none;
margin-left: 0;
}
.\31 2u\24 + *,
.\31 1u\24 + *,
.\31 0u\24 + *,
.\39 u\24 + *,
.\38 u\24 + *,
.\37 u\24 + *,
.\36 u\24 + *,
.\35 u\24 + *,
.\34 u\24 + *,
.\33 u\24 + *,
.\32 u\24 + *,
.\31 u\24 + * {
clear: left;
}
.\-11u {
margin-left: 91.66667%;
}
.\-10u {
margin-left: 83.33333%;
}
.\-9u {
margin-left: 75%;
}
.\-8u {
margin-left: 66.66667%;
}
.\-7u {
margin-left: 58.33333%;
}
.\-6u {
margin-left: 50%;
}
.\-5u {
margin-left: 41.66667%;
}
.\-4u {
margin-left: 33.33333%;
}
.\-3u {
margin-left: 25%;
}
.\-2u {
margin-left: 16.66667%;
}
.\-1u {
margin-left: 8.33333%;
}
html,body{
height:100%;
min-height:100%;
padding:0;
margin:0;
}
#row1{
border:1px solid red
height:0%;
margin:0;
padding:0;
}
.word_position{
}
.word_container {
width: 100%;
text-align: center;
position: absolute;
left: 48%;
top: 50%;
/*width: auto;*/
margin: 0px;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
<div id="main">
<div id="row1" class="row">
<div class="6u 12u(mobile)">
<div class="picture">
<figure>
</figure>
</div>
</div>
<div class="6u 12u(mobile)">
<div class="word_position">
<div class="word_container">
<h1>12312342342442342sdsdf3</h1>
</div>
</div>
</div>
</div>
</div>
這裏是Demo
的可能的複製[製作瀏覽器窗口的分度100%的高度(http://stackoverflow.com/問題/ 1575141/make-div-100-height-of-browser-window)以及通過搜索搜索到的許多類似答案。 – Rob