水平/垂直对齐下的CSS文本

水平/垂直对齐下的CSS文本,css,alignment,Css,Alignment,因此,我有一个页面,其中的文本水平和垂直居中。我想做的是把普通文本放在居中文本下面。 这是到目前为止我的代码 块4O 块4O 正常文本应该在这里(链接等) 身体 { 背景图片:url(“/background.jpg”); 背景重复:无重复; -webkit背景尺寸:封面; -moz背景尺寸:封面; -o-背景尺寸:封面; 背景尺寸:封面; 背景位置:中心; } h1 { 位置:固定; 最高:50%; 左:50%; 转换:翻译(-50%,-50%); 边框:实心; 边框尺寸:8px; 边界半

因此,我有一个页面,其中的文本水平和垂直居中。我想做的是把普通文本放在居中文本下面。 这是到目前为止我的代码


块4O
块4O
正常文本应该在这里(链接等)
身体
{
背景图片:url(“/background.jpg”);
背景重复:无重复;
-webkit背景尺寸:封面;
-moz背景尺寸:封面;
-o-背景尺寸:封面;
背景尺寸:封面;
背景位置:中心;
}
h1
{
位置:固定;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
边框:实心;
边框尺寸:8px;
边界半径:10px;
}
像这样的东西

.main{
位置:固定;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
}
h1{
边框:实心;
边框尺寸:8px;
边界半径:10px;
}

块4O
正常文本应该在这里(链接等)
像这样的东西

.main{
位置:固定;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
}
h1{
边框:实心;
边框尺寸:8px;
边界半径:10px;
}

块4O
正常文本应该在这里(链接等)
希望它能帮助:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>Block4o</title>
<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 {
        text-align: center;
        border: solid;
        border-size: 8px;
        border-radius: 10px;
    }

    div {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
</style>
</head>
<body scroll="no" style="overflow: hidden">

<div>
    <h1>Block4o</h1>
    Normal text should be here (links etc.)
</div>

</body>
</html>

块4O
身体{
背景图片:url(“/background.jpg”);
背景重复:无重复;
-webkit背景尺寸:封面;
-moz背景尺寸:封面;
-o-背景尺寸:封面;
背景尺寸:封面;
背景位置:中心;
}
h1{
文本对齐:居中;
边框:实心;
边框尺寸:8px;
边界半径:10px;
}
div{
位置:固定;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
}
块4O
正常文本应该在这里(链接等)
希望它能帮助:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>Block4o</title>
<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 {
        text-align: center;
        border: solid;
        border-size: 8px;
        border-radius: 10px;
    }

    div {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
</style>
</head>
<body scroll="no" style="overflow: hidden">

<div>
    <h1>Block4o</h1>
    Normal text should be here (links etc.)
</div>

</body>
</html>

块4O
身体{
背景图片:url(“/background.jpg”);
背景重复:无重复;
-webkit背景尺寸:封面;
-moz背景尺寸:封面;
-o-背景尺寸:封面;
背景尺寸:封面;
背景位置:中心;
}
h1{
文本对齐:居中;
边框:实心;
边框尺寸:8px;
边界半径:10px;
}
div{
位置:固定;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
}
块4O
正常文本应该在这里(链接等)