How to override max-width for specific div?

前端 未结 5 2116
后悔当初
后悔当初 2020-12-18 21:58

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

img, a img { 
    max-width: 100%;
    vertical-align: middle; 
}
<
5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-18 22:49

    Ensure that your #pixel-perfect img CSS declaration is BELOW the img, a img declaration, otherwise it will get overwritten.

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

提交回复
热议问题