📜  如何中间文本css代码示例

📅  最后修改于: 2022-03-11 14:47:41.788000             🧑  作者: Mango

代码示例2
/* This is how to put something in the middle of the screen */
/* We are using an h1 element as an example */

h1 {
left: 0;
    line-height: 200px;
    margin-top: -100px;
    position: absolute;
    text-align: center;
    top: 50%;
    width: 100%;
}