在我的react應用中,無論我在哪里放置h1標簽,它都只顯示普通字體。在檢查時,我發現我的文本呈現為h1,但h1的樣式是
。h1, h2, h3, h4, h5, h6{
字體大小: 繼承。
font-weight: inherit;
我也試著在我的global.css中改變了這一點
h1{
font-size: large;
font-weight: 900;
}
但這并不奏效。那么如何將h1渲染成標題1的文字和字體大小呢
uj5u.com熱心網友回復:
。span class="hljs-selector-tag">h1{
字體大小。80px;
font-weight: 900;
}
< h1>Example</h1>
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" class="snippet-box-edit snippet-box-result" frameborder="0"></iframe>
uj5u.com熱心網友回復:
這似乎是特殊性的問題。你的global.css規則被更具體的規則所覆寫。從現有的資訊來看,我不知道這些規則是什么或在哪里。
這將有助于你更好地理解。MDN CSS的特殊性
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/333751.html
標籤:
上一篇:組件之間的回應性
