背景图定位html案例
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>境外保险</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: 100%;
font-weight: normal;
}
.wrap{
width: 225px;
margin: 20px auto;
}
.wrap .top{
border-bottom: 2px solid #0088d3;
}
.wrap .top h2{
font: 22px/40px "微软雅黑";
color: #0088d3;
}
.wrap .img{
width: 225px;
height: 380px;
margin-top: 16px;
overflow: hidden;
background: url(images/ly.jpg) no-repeat;
}
.wrap .img span{
display: block;
margin: 20px auto;
width: 190px;
font: 14px/25px "微软雅黑";
color: #fff;
}
</style>
</head>
<body>
<div class="wrap">
<div class="top">
<h2>境外旅游保险</h2>
</div>
<div class="img">
<span>为境外线路贴心打造,提供意外身故、医疗、24小时紧急搜救等综合保障,异国他乡也能畅行无忧!</span>
</div>
</div>
</body>
</html>
本文来自博客园,作者:JackieDYH,转载请注明原文链接:https://www.cnblogs.com/JackieDYH/p/17634916.html