css3 模拟实现菜单下拉箭头、三角箭头、“大于号”或“小于号”箭头、边框脚

                                                                        

<style>
a{
	display: block;
	width: 50px;
	height: 50px;
	padding: 0 20px;
	background: #000;
	text-decoration: none;
	text-align: center;
	line-height: 50px;
	color: #fff;
}
a .icon_more{
	display: inline-block;!!!
	vertical-align: middle;
	width: 0;
	height: 0;
	border: 5px solid transparent;/*5px 足够了*/
	border-top-color:#000;/*top箭头向下 bottom箭头向上*/
}
a:hover .icon_more{
	transform:rotate(180deg);
	transition: .2s ease-in;
}
</style>
</head>

<body>
  <a href="">更多
	<span class="icon_more"></span>
  </a>
</body>

 ​​​​​​​

<style>
.card_head_btn{
display: flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  font-size: 14px;
  color: rgb(208, 210, 255);
  padding: 0px 18px;
  position: relative;
  cursor: pointer;
  min-width: 62px;
  background: rgba(83, 215, 230, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.card_head_btn.small{
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    padding: 0px 14px 0;
}

.card_head_btn::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 8px;
    height: 8px;
    border-top: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
}

</style>

<div class="card_head_btn small"> 交易类 </div>

<style type="text/css">
.icon_arrow:before {
    content: '';
    display: inline-block;
    border: 6px solid transparent;/*5px 足够了*/
    border-right-color:#333;/*right箭头向左 top箭头向下*/
    position: absolute;
    top: 0%;
    left: 0px;
    margin-top: -6px;
}
</style>
<span class="icon_arrow"></span>

​​​​​​​

CSS实现大于号箭头,而不是直接使用键盘上的尖括号“>”

在这个方法中,是用到了matrix这个CSS3的属性,对于这个属性,可以参考理解CSS3 transform中的Matrix(矩阵)这篇文章。 

.checkdetails:after {
    content: " ";
    display: inline-block;
    height: 10px;
    width: 10px;
    border-width: 2px 2px 0 0;
    border-color: #000;
    border-style: solid;
    -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
    transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
    position: absolute;
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

林中明月间。

分享共赢。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值