CSS中实现空心三角箭头的方法是什么
Admin 2022-11-18 群英技术资讯 780 次浏览
第一种写法 利用常见的 after伪元素
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
title
></
title
>
<
style
type
=
"text/css"
>
.arrow {
width: 20px;
height: 4px;
margin: 0 auto 7px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-bottom: 4px solid #343c99;
transform: rotate(45deg);
transform-origin: left;
}
.arrow:after {
content: '';
display: block;
width: 100%;
height: 100%;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #343c99;
position: absolute;
right: -10px;
top: -14px;
transform: rotate(90deg);
transform-origin: bottom;
}
</
style
>
</
head
>
<
body
>
<
div
class
=
"arrow"
></
div
>
</
body
>
</
html
>
第二种写法相对于比较简单
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
title
></
title
>
<
style
type
=
"text/css"
>
/*简单*/
.wb_arrow{
border-right: 2px solid #343c99;
border-top: 2px solid #343c99;
height: 10px;
width: 10px;
margin:50px auto 0;
transform: rotate(deg);
-webkit-transform: rotate(0deg);
/*不加这两个属性三角会比上一个略丑, 大家可以试一下*/
border-left: 2px solid transparent;
border-bottom: 2px solid transparent;
}
</
style
>
</
head
>
<
body
>
<
div
class
=
"wb_arrow"
></
div
>
</
body
>
</
html
>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
猜你喜欢
这篇文章主要介绍了html实现a元素href的URL链接自动刷新或新窗口打开,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
弹性布局(Flexbox)逐渐流行,越来越多人使用,本文章主要介绍了Flexbox 布局的最简单表单的实现,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
skew函数定义元素在二维平面上的倾斜转换。这种转换是一种剪切映射(横切),在水平和垂直方向上将单元内的每个点扭曲一定的角度。指定一个或两个参数,它们表示在每个方向上应用的倾斜量。
滚动条组成1::-webkit-scrollbar滚动条整体部分2::-webkit-scrollbar-thumb滚动条里面的小方块,能向上向下移动(或往左往右移动,取决于是垂直滚动条还是水平滚动条)3::-webkit-scrollbar-track滚动条的轨道(里面装有Thumb)4::-webkit-scrollbar-button滚动条的轨道的两端按钮,允许
网页input按钮的样式怎样修改呢,方法是什么?一些朋友可能会遇到这方面的问题,对此在下文小编向大家来讲解一下,内容详细,易于理解,希望大家阅读完这篇能有收获哦,有需要的朋友就往下看吧!
成为群英会员,开启智能安全云计算之旅
立即注册Copyright © QY Network Company Ltd. All Rights Reserved. 2003-2020 群英 版权所有
增值电信经营许可证 : B1.B2-20140078 粤ICP备09006778号 域名注册商资质 粤 D3.1-20240008