纯CSS实现上下左右箭头

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
i {
  border: solid black;
  border-width: 0 1px 1px 0;
  display: inline-block;
  padding: 3px;
}

.right {
  transform: rotate(-45deg);
  -webkit-transform: rotate(-45deg);
}

.left {
  transform: rotate(135deg);
  -webkit-transform: rotate(135deg);
}

.up {
  transform: rotate(-135deg);
  -webkit-transform: rotate(-135deg);
}

.down {
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
}
</style>
</head>
<body>

<h2>CSS Arrows</h2>

<p>Right arrow: <i class="right"></i></p>
<p>Left arrow: <i class="left"></i></p>
<p>Up arrow: <i class="up"></i></p>
<p>Down arrow: <i class="down"></i></p>

</body>
</html>

文章来源:纯CSS实现上下左右箭头(>)
http://www.webkaka.com/tutorial/html/2019/090451/

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
<style>

.pre {
      position: relative;
      width: 30px;
      height: 30px;
      background-color: rgba(0, 0, 0, 0.6);
      cursor: pointer;
}
 
.pre::before {
      content: "";
      width: 10px;
      height: 10px;
      border: solid #fff;
      border-width: 2px 2px 0 0;
      transform: translate(-50%, -50%) rotate(-45deg);
      position: absolute;
      left: 50%;
      top: 70%;
}
	
	
	.next {
		position: relative;
		width: 30px;
		height: 30px;
		background-color: rgba(0, 0, 0, 0.6);
		cursor: pointer;
	}
 
	.next::before {
		content: "";
		width: 10px;
		height: 10px;
		border: solid #fff;
		border-width: 0 0 2px 2px;
		transform: translate(-50%, -50%) rotate(-45deg);
		position: absolute;
		left: 50%;
		top: 70%;
	}
	
	
	.left {
		position: relative;
		width: 30px;
		height: 30px;
		background-color: rgba(0, 0, 0, 0.6);
		cursor: pointer;
	}
 
	.left::before {
		content: "";
		width: 10px;
		height: 10px;
		border: solid #fff;
		border-width: 2px 0 0 2px ;
		transform: translate(-50%, -50%) rotate(-45deg);
		position: absolute;
		left: 50%;
		top: 70%;
	}
	
	.right {
		position: relative;
		width: 30px;
		height: 30px;
		background-color: rgba(0, 0, 0, 0.6);
		cursor: pointer;
	}
 
	.right::before {
		content: "";
		width: 10px;
		height: 10px;
		border: solid #fff;
		border-width: 0 2px 2px 0  ;
		transform: translate(-50%, -50%) rotate(-45deg);
		position: absolute;
		left: 50%;
		top: 70%;
	}
	
	
</style>
</head>

<body>
	
<p class="pre"></p>
	
<p class="next"></p>
	
<p class="left"></p>

<p class="right"></p>
	

	
</body>

</html>

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {
            list-style: none;
            color: #666;
            margin: 100px auto;
            padding: 0;
        }
 
        li {
            width: 400px;
            font-size: 30px;
            height: 50px;
            border-bottom: 1px solid #999;
            line-height: 50px;
            margin: 0 auto;
            position: relative;
        }
 
        li::after {
            width: 10px;
            height: 10px;
            border-top: 2px solid;
            border-right: 2px solid;
            border-color: #ccc;
            content: '';
            position: absolute;
            right: 11px;
            top: 20px;
            transform: rotate(45deg);
        }
    </style>
</head>
 
<body>
    <ul>
        <li>我是第1个内容content</li>
        <li>我是第2个内容content</li>
        <li>我是第3个内容content</li>
        <li>我是第4个内容content</li>
        <li>我是第5个内容content</li>
    </ul>
</body>
 
</html>

 

 

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值