display:none不起作用_html/css_WEB-ITnose
來(lái)源:懂視網(wǎng)
責(zé)編:小采
時(shí)間: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
導(dǎ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;}應(yīng)該是除了.handle元素外都隱藏,為什么display: none不起作用呢?
回復(fù)討論(解決方案)
重疊了,前面類的display就無(wú)效。
.reveal * {display: none;}的效果被.reveal *.handle {display: block;}覆蓋了
首先,把這個(gè)注釋改了,style標(biāo)簽(即CSS)里面的注釋是 /* */ ,改成 /*本頁(yè)的css樣式*/
優(yōu)先級(jí)的問(wèn)題,.reveal *.handle高于.reveal * {display: none;},優(yōu)先級(jí)高的生效
這個(gè)不是 css的注意語(yǔ)法 下面一行 樣式就被破壞了
3,4樓正解,謝謝了
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。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