E
E
Eugene Chefranov2017-12-17 03:14:09
css
Eugene Chefranov, 2017-12-17 03:14:09

Why doesn't max-width work?

Why doesn't the following code work in IE and how can I solve it?

.block-text-post p img,
.block-text-post img {
width: auto;
max-width: 100%;
height: auto;
}

<div class="block-text-post">
<a href="#"><img src="img/nf1.png" alt="Картинка"></a>
</div>

In IE, a large picture breaks the layout, in other browsers everything is ok. It's just that the property is width: 100%not suitable, since the pictures can be small and large.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Chefranov, 2017-12-17
@Chefranov

Solved the problem. The problem was that there was a property for the links display: inline-block;and they had to set the maximum width

.block-text-post a {
    display: inline-block;
    max-width: 100%;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question