<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style type="text/css">
a{
position:relative;
display:inline-block;
outline:none;
text-decoration:none;
color:#636;
font-size:24px;
padding:5px 25px;
}
a:hover::before,a:hover::after{
position:absolute; /*注意此处的位置属性*/
}
a:hover::before{
content:"\5B";
left:-5px; /*思考为什么是-5px*/
}
a:hover::after{
content:"\5D";
right:-5px;
}
</style>
</head>
<body>
<a href="http://www.baidu.com">123</a>
<a href="http://www.baidu.com">456</a>
</body>
</html>