用 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