css,禁用display:none;

lol*_*ola 6 css

我的代码中有这种情况:

<!-- This is the global CSS file -->
<style type="text/css">
#show_div{
    display: none;
}
</style>
<!-- This is the local CSS file (only in this page)-->
<style type="text/css">
#show_div{
    /* However to disable display: none;*/  
}
</style>
<body>
<div id = "show_div">
    Text text
</div>
Run Code Online (Sandbox Code Playgroud)

我通常需要隐藏这个元素,但在一个页面上,我需要显示它.在全局css文件中,我有:

#show_div{
    display: none;
}
Run Code Online (Sandbox Code Playgroud)

我怎么禁用display: none;?我不能使用jQuery,$('#show_div').show();(或JavaScript).

谢谢

如果你不明白我的问题,那么我道歉.我可以尝试再解释一下.

Jas*_*son 11

更改要在其上显示的页面的正文类或ID

<style>
#show_table #show_div{
display:block!important;
}
</style>


<body id='show_table'>
<div id='show_div'>
text text 
</div>
Run Code Online (Sandbox Code Playgroud)


Nic*_*ver 5

使用display: block获取默认display<div>元素,就像那朵:

#show_div { display: block; }
Run Code Online (Sandbox Code Playgroud)