本文介紹了css粗體第一個單詞的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
如何使用 CSS 選擇器加粗句子的第一個單詞,就瀏覽器可比性而言,這是一種好/壞的方法嗎?
How can I bold the first word of sentence using CSS selectors and is this a good/bad way to do this with respects to browser comparability?
代碼:
<h2>this is a sentence</h2>
謝謝
推薦答案
CSS中沒有::first-word
偽元素;您必須將第一個單詞包含在一個額外的元素中,然后選擇它.
There is no ::first-word
pseudo-element in CSS; you'll have to wrap the first word in an extra element and then select that.
這篇關于css粗體第一個單詞的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!