实现效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>背景</title>
<style>
.main {
width: 600px;
height: 300px;
background-image: url(https://document.youkeda.com/P3-1-HTML-CSS/1.9/weibo-banner.jpg);
background-size: cover;
position: relative;
}
.au {
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 60px;
padding-left: 10px;
background: linear-gradient(to bottom, rgba(0,0,0,0),rgba(0,0,0,0.9));
}
.title {
font-size: 18px;
font-weight: 700;
line-height: 20px;
color: #FFF;
margin-top: 10px;
}
.b {
font-size: 12px;
line-height: 20px;
color: #FFF;
margin-top: 4px;
}
.discuss {
margin-right: 20px;
}
</style>
</head>
<div class="main">
<div class="au">
<div class="title">#一直单身但颜值超高的人#</div>
<div class="b">
<span class="discuss">1.4万讨论</span>
<span class="read">2443.3万阅读</span>
</div>
</div>
</div>
</body>
</html>