display:none不起作用_html/css_WEB-ITnose
來源:懂視網
責編:小采
時間:2020-11-27 16:30:17
display:none不起作用_html/css_WEB-ITnose
display:none不起作用_html/css_WEB-ITnose: .reveal * {display: none;} /*.reveal * {background-color: gray;}*/ .reveal *.handle {display: block;} .reveal *.handle {background-color: gray;} Click Here to Reveal Hidden Text This paragraph is hidden. It appears when you click o
導讀display:none不起作用_html/css_WEB-ITnose: .reveal * {display: none;} /*.reveal * {background-color: gray;}*/ .reveal *.handle {display: block;} .reveal *.handle {background-color: gray;} Click Here to Reveal Hidden Text This paragraph is hidden. It appears when you click o

Click Here to Reveal Hidden Text
This paragraph is hidden. It appears when you click on title.
.reveal * {display: none;}應該是除了.handle元素外都隱藏,為什么display: none不起作用呢?
回復討論(解決方案)
重疊了,前面類的display就無效。
.reveal * {display: none;}的效果被.reveal *.handle {display: block;}覆蓋了
首先,把這個注釋改了,style標簽(即CSS)里面的注釋是 /* */ ,改成 /*本頁的css樣式*/
優先級的問題,.reveal *.handle高于.reveal * {display: none;},優先級高的生效
這個不是 css的注意語法 下面一行 樣式就被破壞了
3,4樓正解,謝謝了
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
display:none不起作用_html/css_WEB-ITnose
display:none不起作用_html/css_WEB-ITnose: .reveal * {display: none;} /*.reveal * {background-color: gray;}*/ .reveal *.handle {display: block;} .reveal *.handle {background-color: gray;} Click Here to Reveal Hidden Text This paragraph is hidden. It appears when you click o