【发布时间】:2014-12-14 06:00:20
【问题描述】:
您好,我有一个页面,我想让方块垂直和水平地出现在页面中间。我有一个容器,我希望大约 80% 的页面在两边留出 20% 的空间。我想知道如何才能使所有浏览器和设备都完全响应。
HTML
<div class="splashcontainer">
<h1 class="splashheader">Title</h1>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
CSS
.splashcontainer{
margin: 0 auto;
width: 80%;
height: 100%;
min-height: 100%;
}
.splashheader{
text-align: center;
font-size: 62px;
font-family: font-family: 'Montserrat', sans-serif;
}
.splashcontainer div{
width: 20%;
margin: 0px 2% 0 2%;
padding-bottom: 20%;
background-color: deepskyblue;
display: inline-block;
}
谢谢,
【问题讨论】:
标签: html css responsive-design