生活随笔
收集整理的這篇文章主要介紹了
CSS设置文字粗细
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
CSS設置文字粗細
? ? ? ? ? HTML中通過添加<b>標記,或者<strong>標記來設置文字的粗細。
? ? ? ? ??CSS可以將文字的粗細進行了細致的劃分,而且,還可以將本身是粗體的文字,變為正常的粗細顯示。
<span style="font-size:24px;"><html><head><title>文字粗細</title><style><!--
h1 span{font-weight:lighter;}
span{font-size:30px;}
span.one{font-weight:100;}
span.two{font-weight:200;}
span.three{font-weight:300;}
span.four{font-weight:400;}
span.five{font-weight:500;}
span.sex{font-weight:600;}
span.seven{font-weight:700;}
span.eight{font-weight:800;}
span.nine{font-weight:900;}
span.ten{font-weight:bold;}
span.eleven{font-weight:normal;}
--></style></head><body><h1>文字<span>粗</span>體</h1><span class="one">文字粗細:100</span><span class="two">文字粗細:200</span><span class="three">文字粗細:300</span><span class="four">文字粗細:400</span><span class="five">文字粗細:500</span><span class="six">文字粗細:600</span><span class="seven">文字粗細:700</span><span class="eight">文字粗細:800</span><span class="nine">文字粗細:900</span><span class="ten">文字粗細:bold</span><span class="eleven">文字粗細:normal</span></body>
</html>
</span>
? ? ? ? ??文字的粗細在CSS中通過屬性:font-weight設置,如上代碼幾乎涵蓋了所有的文字粗細值,并且,可以是本身是粗體的字體,變成正常粗體。
?
總結
以上是生活随笔為你收集整理的CSS设置文字粗细的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。