1
The problem is this: I have the following html:
<div class="page-left-col">
<p>
<img src="/localhost/Department%20Pages/Communications/News/LearnStorm%20Rally.jpg" style="display: block; margin: 20px auto;" width="400">
</p>
</div>
And in css it’s like this:
div.page-left-col img {
width: 100%;
}
I would like to take this width 400 (example) that is in html and tell my css that this width will be max-width, because I need to leave this width as 100% even for it to adapt to the size of the windows. I can not leave 400 fixed, because depending on the new post, this image can be set with any other size in width. What I need to know is if there’s a way to say in css that max-width is the width you have in html.
Uses DOM/Jquery.
– DH.
Hello, I’m afraid I don’t understand your question. Is this trying to say if loading the page width is 200px and if the user maximizes the window should be 200px? Or what you want is to always be 100% but at most 400px?
– Tiago Gomes
Always 100% but at most 400px, @Tiagogomes. Actually, not specifically 400, which is why I don’t want to max-width:400px. Because there can come any value. What I want is always 100% and maximum the value that comes in HTML width
– Araújo Filho
Ever tried a max-width: 100%
– Bruno Romualdo
Yes @Bruno. It doesn’t work
– Araújo Filho
There would be no way to show an example page, I think it would be much easier to help you.
– Bruno Romualdo