如何覆盖特定div的最大宽度? [英] How to override max-width for specific div?

查看:131
本文介绍了如何覆盖特定div的最大宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am searching for the following solution. In my CSS I have the following:

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

此代码对于我的WordPress主题和自适应Web设计是必需的.现在,我想将max-width属性覆盖为auto.当我这样做时,它不会覆盖:

This code is necessary for my WordPress theme and responsive web design. Now I want to override max-width property to auto. When I do this, it doesn't override:

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

我做错了什么?

推荐答案

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

Are you just looking to unset the max-width property? If so, try:

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

这篇关于如何覆盖特定div的最大宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆