2021-01-11
阿新 • • 發佈:2021-01-12
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> a{ text-decoration: none;/*取消下劃線*/ } #btn{ width: 300px; height: 40px; line-height: 40px;/*當高度和線高度相同時就會垂直居中*/ color: white;/*字型顏色*/ text-align: center;/*水平居中*/ letter-spacing: 15px; cursor: pointer;/*調換滑鼠指標的形狀*/ border: 1px solid #e85356; background-color: #e4393c; } </style> </head> <body> <a href="http:\\www.baidu.com">百度</a> <div id="btn">登入</div> <!-- 有些css樣式在行內元素無效,新增display:block --> <span style="display: block;">鄭州</span><!--將行內轉換為塊級--> <div style="display: inline;">新鄭市</div><!--將塊級轉換為行內,當你不想讓他獨立成行時或者其他情況--> </body> </html>
常用css