您的位置:首页 > Web前端 > CSS

CSS——模仿按钮2(hover)

2017-10-18 19:48 183 查看
模仿按钮如下:(模仿的是w3school   http://www.w3school.com.cn/cssref/selector_nth-child.asp)



<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
a {
text-decoration: none;
}
.search_btn {
display: inline-block;
padding: 0 40px;
text-align: center;
color: #FFF;
background-color: rgb(233,104,107);
height: 42px;
margin-right: 10px;
border: none;
font-size: 14px;
line-height: 42px;
border-radius: 5px;
vertical-align: middle;
font-family: 微软雅黑;
transition: 0.2s ease-out;
}
.search_btn:hover {
background-color: #ba3537;
}
</style>
</head>
<body>
<a href="http://www.baidu.com" class="search_btn">搜索</a>
</body>
</html>效果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: