Html去除a標簽的默認樣式的操作代碼

Html去除a標簽的默認樣式,
a標簽超鏈接字體默認藍色帶下劃線;
去除可用:
a{ text-decoration:none; color:inherit; cursor:auto; }
測試代碼
<!DOCTYPE html> <html lang="zh-CN" dir="ltr"><head><meta charset="utf-8"/><title>Ctrl ae uk ak Bash</title><style id="Style001"> a{ text-decoration:none; color:inherit; cursor:auto; } </style></head><body> <div> <a>這是一個a標簽, 去掉a標簽的樣式, 用了??</a> <a></a> <script> const Style001 = document.getElementById("Style001"); document.currentScript.previousElementSibling.innerHTML = '<pre style="font-size:66px;">' + document.getElementById("Style001").innerHTML + '</pre>'; </script> </div> </body></html>
效果
text-decoration 屬性
text-decoration
CSS 簡寫屬性設置文本上的裝飾性線條的外觀。它是 text-decoration-line
、text-decoration-color
、text-decoration-style
和較新的 text-decoration-thickness
屬性的縮寫。
text-decoration
可以設置1到4個參數(shù), 允許不分先后, 分別為:
- line劃線種類
text-decoration-line
- color劃線顏色
text-decoration-color
- style劃線樣式
text-decoration-style
- thickness劃線厚度
text-decoration-thickness
text-decoration-line
none
無修飾。overline
上劃線。line-through
中劃線, 有一條貫穿文本中間的修飾線。underline
下劃線。
text-decoration-color
設置劃線顏色
text-decoration-color:red; text-decoration-line:underline 可寫成, 不分前后 text-decoration: red underline;
text-decoration-style
text-decoration-style: solid; /*** 實線 ***/ text-decoration-style: double; /*** 雙實線 ***/ text-decoration-style: dotted; /*** 點劃線 ***/ text-decoration-style: dashed; /*** 虛線 ***/ text-decoration-style: wavy; /*** 波浪線 ***/
text-decoration-thickness
文本裝飾線厚度 (粗細)
CSS 屬性 text-decoration-thickness 用于設置元素中文本所使用的裝飾線(如 line-through、underline 或 overline)的筆觸厚度。
取值:
auto
: 由瀏覽器為文本裝飾線選擇合適的厚度。from-font
: 如果字體文件中包含了首選的厚度值,則使用字體文件的厚度值。如果字體文件中沒有包含首選的厚度值,則效果和設置為 auto 一樣,由瀏覽器選擇合適的厚度值。- 長度, 如 1em , 2px,
- 百分比, 如 10%
/* Single keyword */ text-decoration-thickness: auto; text-decoration-thickness: from-font; /* 長度*/ text-decoration-thickness: 0.1em; text-decoration-thickness: 3px; /* 百分比*/ text-decoration-thickness: 10%;
可以寫在text-decoration
四個參數(shù)位置的任意位置
到此這篇關于Html去除a標簽的默認樣式的文章就介紹到這了,更多相關html a標簽內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持腳本之家!
相關文章
- 這篇文章主要介紹了html post請求之a(chǎn)標簽的兩種用法,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友參考下吧2020-05-12
- 這篇文章主要介紹了HTML常用meta大全(推薦),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2019-12-30
- area 元素總是嵌套在 <map> 標簽中。本文重點給大家介紹html area標簽的相關知識,需要的朋友參考下吧2018-10-15
- 這篇文章主要介紹了HTML中的<meta>標簽的使用,非常不錯,具有一定的參考借鑒價值,需要的朋友參考下吧2018-06-05
- <meta> 元素可提供有關頁面的元信息(meta-information),比如針對搜索引擎和更新頻度的描述和關鍵詞。這篇文章給大家介紹了html中meta標簽及用法詳解,感興趣的朋2018-02-23
- <a>是超鏈接標簽,什么是超鏈接呢?這篇文章主要介紹了HTML超鏈接a標簽的相關資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-06-21
- 下面就為大家?guī)硪黄猦tml meta標簽的使用總結(推薦)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-08-08
- 寫在Web的head頭部中的mata標簽看似不起眼,實則可以設置非常多種的功能,包括頁面編碼等重要設定,這里我們便來總結HTML的meta標簽常見用法集錦:2016-07-11
HTML的a標簽href屬性指定相對路徑與絕對路徑的用法講解
href是鏈接前端文件的一個最常用的重要屬性,這里我們就來看一下HTML的a標簽href屬性指定相對路徑與絕對路徑的用法講解,需要的朋友可以參考下2016-07-11- 這篇文章主要介紹了HTML中META標簽的一些使用技巧,共舉了10個小例子,HTML5中META標簽也有演進,可以說是HTML學習中的重要知識點,需要的朋友可以參考下2015-12-08