CSS3中的按钮边框特效能够让网站界面变得更加美观,该特效根据不同的设计需求,可以展现出不同的效果。以下是一些使用CSS3按钮边框特效的实例。 首先,我们来展示一个简单的CSS3按钮边框特效: .b...
CSS3中的按钮边框特效能够让网站界面变得更加美观,该特效根据不同的设计需求,可以展现出不同的效果。以下是一些使用CSS3按钮边框特效的实例。
首先,我们来展示一个简单的CSS3按钮边框特效:
.button {
border: 2px solid #5e8cd6;
padding: 10px 20px;
font-size: 1.2em;
color: #fff;
background-color: #5e8cd6;
border-radius: 5px;
transition: all 0.2s;
}
<br>
.button:hover {
background-color: #4a7cd1;
border: 2px solid #4a7cd1;
cursor: pointer;
} .button2 {
position: relative;
border: none;
padding: 10px 20px;
font-size: 1.2em;
color: #fff;
background-color: #5e8cd6;
border-radius: 5px;
transition: all 0.2s;
overflow: hidden;
}
<br>
.button2::before {
content: "";
position: absolute;
top: 100%;
left: 100%;
width: 0;
height: 0;
border-top: 2px solid #4a7cd1;
border-left: 2px solid #4a7cd1;
transform: translate(-50%, -50%) rotate(45deg);
transition: all 0.5s;
}
<br>
.button2:hover::before {
width: 100%;
height: 100%;
transition: all 0.5s;
}