css3常见应用-按钮样式-20180524

<style>

.button{

background-color:#4CAF50;/*Green*/

border:none;

color:white;

padding:15px32px;

text-align:center;

text-decoration:none;

display:inline-block;

font-size:16px;

margin:4px2px;

cursor:pointer;

}

.button2{background-color:#008CBA;}/*Blue*/

.button3{background-color:#f44336;}/*Red*/

.button4{background-color:#e7e7e7;color:black;}/*Gray*/

.button5{background-color:#555555;}/*Black*/

</style>

</head>

<body>

<h2>按钮颜色</h2>

<p>我们可以使用background-color属性来设置按钮颜色:</p>

<buttonclass="button">Green</button>

<buttonclass="buttonbutton2">Blue</button>

<buttonclass="buttonbutton3">Red</button>

<buttonclass="buttonbutton4">Gray</button>

<buttonclass="buttonbutton5">Black</button>

先button然后button2的样式

转自:http://www.runoob.com/try/try.php?filename=trycss_buttons_color

相关推荐