
先来看一下效果图:

(相关视频教程推荐:css视频教程)
CSS代码:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>棒棒糖</title>
<h3>用css画一个棒棒糖</h3>
<p>要求:</p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/cb6835dc7db1" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">前端免费学习笔记(深入)</a>”;</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/1319">
<img src="https://img.php.cn/upload/ai_manual/000/000/000/175680201295703.jpg" alt="AI Undetect">
</a>
<div class="aritcle_card_info">
<a href="/ai/1319">AI Undetect</a>
<p>让AI无法察觉,让文字更人性化,为文字体验创造无限可能。</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="AI Undetect">
<span>162</span>
</div>
</div>
<a href="/ai/1319" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="AI Undetect">
</a>
</div>
<p>1:棒棒糖中间文字为水平居中</p>
<p>2:不得少于三层颜色</p>
<style>
.round{
width: 100px;
height: 100px;
background-color: #e5e7e9;
position: relative;
text-align: center;
margin: 100px;
font: italic bold 17px/100px arial,sans-serif;
box-shadow:
0 0 0 10px #4286b4,
0 0 0 20px #fc052e,
0 0 0 30px #FBDD00,
0 0 0 40px #00BDFB;
border-radius: 200px;
color: #ffffff;
}
.bangbang{
width: 20px;
height: 150px;
margin: -80px 0px 0px 142px;
background-color: #00BDFB;
border-radius: 10px;
}
</style>
</head>
<body>
<div>
hello world!
</div>
<div></div>
</body>
</html>推荐教程:css快速入门
以上就是如何使用css来画一个棒棒糖的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号