matt
matt

Reputation: 44293

css min-width and max-width?

.post-body p img {
    min-width:100%;
    margin-bottom:15px;
}
.post-body p img.thumb-small {
    min-width:auto !important;
    max-width:100%;
    margin-bottom:15px;
}

i want all my images inside of post-body p to be min-width 100%. However if the image has a class of thumb-small there should be NO min-width? how can i reverse that behaviour for images with this class?

thank you

Upvotes: 1

Views: 5036

Answers (4)

thirtydot
thirtydot

Reputation: 228162

min-width: inherit

Upvotes: 1

AJJ
AJJ

Reputation: 7703

Haven't checked it, but

min-width: 0;

should work, no need for !important, you are already overriding the rule with the added class.

Upvotes: 1

Guffa
Guffa

Reputation: 700212

You could just specify a min-width of zero for the thumbnails:

.post-body p img.thumb-small {
    min-width: 0;
    max-width: 100%;
    margin-bottom: 15px;
}

You don't need the !important. The style rule is more specific, so it will take precedence anyway.

Upvotes: 1

Flack
Flack

Reputation: 5892

how can i reverse that behaviour for images with this class?

.post-body p img.thumb-small {
    min-width:0;
    }

Upvotes: 1

Related Questions