css怎么写五角星
时间:2021-07-28
来源:互联网
今天PHP爱好者给大家带来css写五角星的方法:首先创建一个HTML示例文件;然后通过small名class创建p;最后通过设置“transform: rotate(70deg);”等样式来实现五角星即可。希望对大家有所帮助。
本文操作环境:windows7系统、HTML5&&CSS3版,DELL G3电脑
使用css实现五角星
大五角星
通过small名class创建p
.small-all{
display: flex;
margin:1rem 13%;
}
.small {
border-color: #7d7d7d transparent transparent transparent;
border-style: solid;
border-top-width: 9.375px;
border-right-width: 15px;
border-left-width: 15px;
height: 0;
margin-top: 9.375px;
margin-bottom: 6.02679px;
position: relative;
width: 0;
margin: 2rem 0.8rem;
}
.small:before,.small:after {
border-color: #7d7d7d transparent transparent transparent;
border-style: solid;
border-top-width: 9.375px;
border-right-width: 15px;
border-left-width: 15px;
content: '';
display: block;
height: 0;
left: -15px;
position: absolute;
top: -9.375px;
width: 0;
}
.small:before {
transform: rotate(70deg);
}
.small:after {
transform: rotate(-70deg);
}
实现效果
小五角星
通过smaller名class创建p
.smaller {
border-color: #7d7d7d transparent transparent transparent;
border-style: solid;
border-top-width: 5px;
border-right-width: 10px;
border-left-width: 10px;
height: 0;
margin-right: 1.2rem;
margin-top: 5px;
margin-bottom: 3.21429px;
position: relative;
width: 0;
}
.smaller:before,.smaller:after {
border-color: #7d7d7d transparent transparent transparent;
border-style: solid;
border-top-width: 5px;
border-right-width: 10px;
border-left-width: 10px;
content: '';
display: block;
height: 0;
left: -10px;
position: absolute;
top: -5px;
width: 0;
}
.smaller:before {
transform: rotate(70deg);
}
.smaller:after {
transform: rotate(-70deg);
}
实现效果
以上就是css怎么写五角星的详细内容,更多请关注php爱好者其它相关文章!
-
币安APP怎么添加指纹解锁?-安全设置详细教程 时间:2025-05-14
-
《我的相册里一半是自拍,一半是风景(假装在旅游)》 时间:2025-05-14
-
币安如何参与链上投票?-治理代币投票流程解析 时间:2025-05-14
-
币安稳定币有哪些?-支持的稳定币种与用途分析 时间:2025-05-14
-
《“我今天不生气”——然后就被一句话破防了》 时间:2025-05-14
-
币安怎么创建子账户?-子账号开通与权限设置指南 时间:2025-05-14
今日更新
-
php怎么修改80端口
阅读:18
-
php foreach怎么停止循环
阅读:18
-
php ini_get怎么修改配置
阅读:18
-
javascript怎么移除li
阅读:18
-
php replace 正则替换方法
阅读:18
-
firefox怎么关闭javascript
阅读:18
-
解析ThinkPHP5如何引入Go AOP和PHP AOP编程
阅读:18
-
php excel怎么转换成pdf
阅读:18
-
详解laravel如何安装jenssegers/laravel
阅读:18
-
javascript怎么打印
阅读:18