【发布时间】:2016-05-10 04:22:47
【问题描述】:
所以,我有一个页面,其中包含水平和垂直居中的文本。我想要做的是将普通文本放在该居中文本下。 到目前为止,这是我的代码。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>Block4o</title>
</head>
<body scroll="no" style="overflow: hidden">
<h1>Block4o</h1>
Normal text should be here (links etc.)
</body>
</html>
<style>
body
{
background-image: url("/background.jpg");
background-repeat:no-repeat;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
background-position:center;
}
h1
{
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border:solid;
border-size: 8px;
border-radius: 10px;
}
</style>
【问题讨论】: