text-decoration-style
åºçº¿
广æ³å¯ç¨
èª 2020å¹´1æ èµ·ï¼æ¤ç¹æ§å·²å¨ä¸»æµæµè§å¨ä¸å¾å°æ¯æï¼å¯å¨å¤§å¤æ°è®¾å¤åæµè§å¨çæ¬ä¸æ£å¸¸ä½¿ç¨ã
CSS 屿§ text-decoration-style ç¨äºè®¾ç½®ç± text-decoration-line 设å®ççº¿çæ ·å¼ãçº¿çæ ·å¼ä¼åºç¨å°ææè¢« text-decoration-line 设å®ç线ï¼ä¸è½ä¸ºå
¶ä¸çæ¯æ¡çº¿è®¾ç½®ä¸åçæ ·å¼ãå½è¦è®¾ç½®å¤ä¸ªçº¿ä¿®é¥°å±æ§æ¶ï¼ç¨ text-decoration ç®å屿§ä¼æ¯åå«åå¤ä¸ªå±æ§æ´æ¹ä¾¿ã
å°è¯ä¸ä¸
text-decoration-style: solid;
text-decoration-style: double;
text-decoration-style: dotted;
text-decoration-style: dashed;
text-decoration-style: wavy;
<section id="default-example">
<p>
I'd far rather be
<span class="transition-all" id="example-element">happy than right</span>
any day.
</p>
</section>
p {
font: 1.5em sans-serif;
}
#example-element {
text-decoration-line: underline;
}
å¦æè®¾å®ç修饰ææå
·æç¹å®çè¯ä¹ï¼ä¾å¦å é¤çº¿çæå³çæäºææ¬è¢«å é¤äºï¼å¼åè
æå¥½ä½¿ç¨æè¯ä¹ç HTML æ ç¾æ¥è¡¨è¾¾ï¼æ¯å¦ <del> æ <s> æ ç¾ï¼å 为æµè§å¨ææ¶å¯è½ä¼å±è½æäºæ ·å¼ï¼ä½è¯ä¹åçæ ç¾åä¸ä¼åºç°è¿æ ·çé®é¢ã
å½ä¸æ¬¡ä½¿ç¨å¤ä¸ª line-decoration 屿§æ¶ï¼ä½¿ç¨ text-decoration ç®å屿§ä¼æ´æ¹ä¾¿ã
è¯æ³
/* Keyword values */
text-decoration-style: solid;
text-decoration-style: double;
text-decoration-style: dotted;
text-decoration-style: dashed;
text-decoration-style: wavy;
/* Global values */
text-decoration-style: inherit;
text-decoration-style: initial;
text-decoration-style: unset;
å¼
å½¢å¼è¯æ³
text-decoration-style =
solid |
double |
dotted |
dashed |
wavy
示ä¾
.example {
-moz-text-decoration-line: underline;
-moz-text-decoration-style: wavy;
-moz-text-decoration-color: red;
-webkit-text-decoration-line: underline;
-webkit-text-decoration-style: wavy;
-webkit-text-decoration-color: red;
}
.wavy {
text-decoration-line: underline;
text-decoration-style: wavy;
text-decoration-color: red;
}
<p class="wavy">This text has a wavy red line beneath it.</p>
è§è
| è§è |
|---|
| CSS Text Decoration Module Level 3> # text-decoration-style-property> |
æµè§å¨å ¼å®¹æ§
åè§
- å½è¦è®¾ç½®å¤ä¸ªçº¿ä¿®é¥°å±æ§æ¶ï¼ç¨
text-decorationç®å屿§ä¼æ¯åå«åå¤ä¸ªå±æ§æ´æ¹ä¾¿