有大神么?怎么用css的after,before做梯形hover
本文介绍了有大神么?怎么用css的after,before做梯形hover的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
鼠标移上去hover状态如图。这个要什么写?O(∩_∩)O谢谢!
解决方案
直接使用css3 transform skew实现
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
a{
display: inline-block;
line-height: 30px;
font-size: 16px;
text-align: center;
color:white;
background: red;
border-radius: 5px;
padding: 0 20px;
text-decoration: none;
}
a:hover{
transform-origin: bottom;
transform: skew(-30deg);
}
</style>
</head>
<body>
<a href="javascript:;">
帮助文档
</a>
</body>
</html>
这篇关于有大神么?怎么用css的after,before做梯形hover的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文