html - 显示属性的优先级,当在同一个 div 中给出两个显示属性时

标签 html css

这是我的 div 标签。

<div class="@Html.Raw(ViewBag.TabClass) 

在 tabclass 中,我附加了另外两个 css 类。一个类包含display:none,另一个类包含display: inline

我需要两个类都存在并且 display:hidden 应该应用于整个 div。

这可能吗?

最佳答案

在 css 显示处添加 !important

示例:

display:none !important;

关于html - 显示属性的优先级,当在同一个 div 中给出两个显示属性时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46811987/

相关文章:

css - 仅当没有足够的屏幕空间来显示它们时,如何让我的 DIV 元素换行?

jquery - 覆盖 jQuery 移动按钮样式

javascript - 删除上一个 TR 中的样式

java - 从 HTML 文本中获取特定值

html - 两个外部 CSS ID,但只有第一个有效

css - 调整大小时 Bootstrap 列不起作用

html - CSS - 图像不显示

html - 如何在css中合并两个类

html - 为图像创建双圆边框

javascript - 代码可以在 jsfiddle 中运行,但不能在 html 文件中运行