展开全部
<!DOCTYPE HTML>
<html>
<head>
<meta charset= "utf8">
<title>untitled</title>
<link rel = "stylesheet" type = "text/css" href = "">
<style type = "text/css">
#a{
width: 500px;
height: 200px;
background-image: url('pic.png');
margin-left: calc((100% - 500px)/2);
margin-top: 200px;
}
#a div{
position: absolute;
width: 500px;
height: 40px;
background-color: black;
margin-top: 160px;
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
text-align: center;
line-height: 40px;
font-size: 20px;
}
</style>
</head>
<body>
<div id = 'a'>
<div>白颜色的字</div>
</div>
<script type="text/javascript">
</script>
</body>
</html>
#a background-image url 自己修改一下
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询