在css中,可以利用“border-bottom”屬性和“text-decoration”屬性讓a標簽下面的線加粗,語法為“a{text-decoration:none;border-bottom:線的粗細值 solid 顏色值;}”。
本教程操作環境:windows10系統、css3&&html5版、dell g3電腦。
css中a標簽下面的線怎么加粗
在css中,可以利用border-bottom屬性和text-decoration屬性來讓a標簽下面的線加粗,
text-decoration屬性用于規定添加到文本的修飾,border-bottom屬性用于設置元素的下邊框樣式,因此,我們可以先把a標簽原本的下劃線去除掉,使用a標簽元素的下邊框來作為a標簽下面的線,這樣只需要設置a標簽下邊框的粗細值就可以了。
示例如下:
<!doctype html><html lang=\”en\”><head> <meta charset=\”utf-8\”> <meta name=\”viewport\” content=\”width=device-width, initial-scale=1.0\”> <meta http-equiv=\”x-ua-compatible\” content=\”ie=edge\”> <title>document</title> <style> a{ color:red; border-bottom:5px solid red; text-decoration:none; } </style></head><body> <a href=\”\”>這是一個a標簽</a></body></html>
輸出結果:
(學習視頻分享:css視頻教程)
阿里云服務器ecs鏡像類型如何訪問華為云服務器配置盤點網站里那些必須要優化的內容請問一下有沒有之前的那種備案方式網站升級后打不開-虛擬主機/數據庫問題搭建網站選擇什么虛擬主機百度云服務器加系統盤能掛在阿里云服務器上的java項目