css - 如何覆盖特定 div 的最大宽度?

标签 css

我正在寻找以下解决方案。在我的 CSS 中,我有以下内容:

img, a img { 
    max-width: 100%;
    vertical-align: middle; 
}

此代码是我的 WordPress 主题和响应式网页设计所必需的。现在我想将 max-width 属性重写为 auto。当我这样做时,它不会覆盖:

#pixel-perfect img {
    max-width: auto !important;
    position: absolute;
    margin: -200px 0 0 -140px;
    z-index: -9999;
}

我做错了什么?

最佳答案

您只是想取消设置 max-width 属性吗?如果是这样,请尝试:

#pixel-perfect img {
    max-width: none;
}

关于css - 如何覆盖特定 div 的最大宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19894059/

相关文章:

android - 我怎样才能像 phonegap 中的 View 一样获得 Google chrome 浏览器?

css - 重置字体大小 :0 doesn't work with 'em' unit

css - 在 div 内部移动以最小化屏幕宽度

javascript - 根据日期和时间标准显示网页

css - jquery为DIV动态追加类

html - 图片上的链接在 Internet Explorer 中显示图片周围的边框

javascript - 随机消失的文本效果 - 使用 jQuery 选择随机 Div

javascript - 带有链接的 jQuery Mobile 列表格式

javascript - 动态添加时 Span 元素溢出

html - 为什么我的页脚上的 CSS 边框将页面推到 100% 以上