热门关键字:
jquery > jquery教程 > div+css > 页面自适应

页面自适应

220
作者:管理员
发布时间:2020/4/30 16:09:55
评论数:0
转载请自觉注明原文:http://www.jq-school.com/Show.aspx?id=1507
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>





如果您觉得本文的内容对您的学习有所帮助:支付鼓励



关键字:页面自适应
友荐云推荐