Files
front-end-example/02-css-layout/04-position-badge/starter.html
2026-03-12 22:56:33 +08:00

66 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>定位与徽标</title>
<style>
body{
background-color: rgb(247, 240, 230);
display: flex;
justify-content: center;
}
.card{
border: 1px solid rgba(254, 184, 114, 0.469);
border-radius: 15px;
background-color: white;
width: 400px;
height: 230px;
box-shadow: 10px 10px 15px rgba(252, 219, 186, 0.469);
margin-top: 150px;
position: relative;
}
.badge{
background-color: rgb(253, 133, 21);
color: white;
padding: 5px 8px 5px 10px;
border-radius: 20px;
width: 40px;
position: absolute;
right: 20px;
top: -10px;
}
h1{
margin-left: 20px;
margin-top: 50px;
}
p{
margin-left: 20px;
margin-bottom: 50px;
}
a{
text-decoration: none;
color: rgb(165, 75, 42);
font-weight: 800;
margin-bottom: 5px;
margin-left: 20px;
padding-bottom: 5px;
}
</style>
</head>
<body>
<article class="card">
<span class="badge">热门</span>
<h1>CSS 布局专项课</h1>
<p>重点掌握盒模型、Flex、定位和常见页面排版方式。</p>
<a href="#">查看详情</a>
</article>
</body>
</html>