html:(34):下划线和删除线
生活随笔
收集整理的這篇文章主要介紹了
html:(34):下划线和删除线
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文字排版--下劃線
有些情況下想為文字設置為下劃線樣式,這樣可以在視覺上強調文字,可以使用下面代碼來實現:
p a{text-decoration:underline;}<p>三年級時,我還是一個<a>膽小如鼠</a>的小女孩。</p> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>下劃線樣式</title> <style type="text/css"> a {text-decoration:underline; } span{text-decoration:underline;} </style> </head><body><span>三年級</span> <p>三年級時,我還是一個<a>膽小如鼠</a>的小女孩。</p> </body> </html>運行結果
文字排版--刪除線
如果想在網頁上設置刪除線怎么辦,這個樣式在電商網站上常會見到:
上圖中的原價上的刪除線使用下面代碼就可以實現:
.oldPrice{text-decoration:line-through;} <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>刪除樣式</title> <style type="text/css"> .oldPrice{text-decoration:line-through;} </style> </head> <body> <p>原價:<span class="oldPrice">300</span>元 現價:230 元</p> </body> </html>運行結果
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的html:(34):下划线和删除线的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 高德地图:No implementati
- 下一篇: v380pro设备连接失败_天猫精灵可以