用 CSS 做一个美化的 button 按钮


效果图:

 

<head>
<meta charset="utf-8">
<title>无标题文档</title>
	<style>
		button{
			width: 200px;/*设置按钮宽度*/
			height: 30px;/*设置按钮高度*/
			color:white;/*字体颜色*/
			background-color:cornflowerblue;/*按钮背景颜色*/
			border-radius: 3px;/*让按钮变得圆滑一点*/
			border-width: 0;/*消去按钮丑的边框*/
			margin: 0;
			outline: none;/*取消轮廓*/
			font-family: KaiTi;/*字体设置为楷体*/
			font-size: 17px;/*设置字体大小*/
			text-align: center;/*字体居中*/
			cursor: pointer;/*设置鼠标箭头手势*/
		}
		button:hover{/*鼠标移动时的颜色变化*/
			background-color: antiquewhite;
		}
	</style>
</head>

<body>
	<button>确认</button>
</body>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM