zoukankan      html  css  js  c++  java
  • 页面自适应

    html部分


    <div class="div1">
    <div class="div2">
    <span class="headLine">这是一个自适应的标题</span>
    </div>
    </div>

    css部分

    .div1{
    position: relative;
    }

    .div2{
    position: absolute;
    text-align: center;
    left: 0;
    right: 0;
    top: 60px;


    }

    .headLine{
    font-size: 45px;

    border:2px solid black;
    /*border-radius: 20%;*/
    padding: 10px 10px;
    }

    完整模板代码

    <!doctype html>

    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>自适应页面</title>
    <style type="text/css">
    .div1{
    position: relative;
    }

    .div2{
    position: absolute;
    text-align: center;
    left: 0;
    right: 0;
    top: 60px;


    }

    .headLine{
    font-size: 45px;

    border:2px solid black;
    /*border-radius: 20%;*/
    padding: 10px 10px;
    }
    </style>
    </head>
    <body>
    <div class="div1">
    <div class="div2">
    <span class="headLine">这是一个自适应的标题</span>
    </div>
    </div>
    </body>
    </html>


    
    
  • 相关阅读:
    转载一篇 Linux 命令总结
    Linux 常用命令学习
    frp 使用
    Anaconda使用记录
    Linux 学习
    lnmp下django学习
    lnmp安装学习
    学习DHT内容
    pyqt5配置
    MyBatisPlus 常用知识点总结
  • 原文地址:https://www.cnblogs.com/nuister/p/adaptive_page.html
Copyright © 2011-2022 走看看