Home > Web Front-end > HTML Tutorial > 用事件与CSS改变按钮不同状态下的颜色_html/css_WEB-ITnose

用事件与CSS改变按钮不同状态下的颜色_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:21:14
Original
1364 people have browsed it

目标效果:

    表单的群发按钮,在鼠标悬停时为深蓝色,鼠标离开时为淡蓝色。

HTML代码:

    
            

CSS代码:

.btn{
    color:#ffffff;
    background:#44b549;
    padding-top:3px;
    border-top: 1px solid #44b549;
    border-right: 1px solid #44b549;
    border-bottom: 1px solid #44b549;
    border-left: 1px solid #44b549;
    width:100px;
    height:30pt;
    font-size:15pt;
    border-radius:3em;
    background-image: linear-gradient(to bottom, #44b549 0px, #44b549 100%);
    -moz-border-radius: 5px;
}     注意一定不能少了这一段,此段定义打开页面时按钮的初始样式。若没有这段,页面打开时按钮不显示样式,直至有鼠标悬停。

 

.input_move{
    color:#ffffff;
    background:#006600;
    padding-top:3px;
    border-top: 1px solid #006600;
    border-right: 1px solid #006600;
    border-bottom: 1px solid #006600;
    border-left: 1px solid #006600;
    width:100px;
    height:30pt;
    font-size:15pt;
    border-radius:3em;
    background-image: linear-gradient(to bottom, #006600 0px, #006600 100%);
    -moz-border-radius: 5px;
}
.input_out{
    color:#ffffff;
    background:#44b549;
    padding-top:3px;
    border-top: 1px solid #44b549;
    border-right: 1px solid #44b549;
    border-bottom: 1px solid #44b549;
    border-left: 1px solid #44b549;
    width:100px;
    height:30pt;
    font-size:15pt;
    border-radius:3em;
    background-image: linear-gradient(to bottom, #44b549 0px, #44b549 100%);
    -moz-border-radius: 5px;
}

    

 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template