Answer the question
In order to leave comments, you need to log in
How to make stretchable images in HTML?
Help to make HTML page.
There is an article that contains images. The article can be viewed both on a large monitor and on a phone with a resolution of 800x480.
In order for the article to look normal on a large monitor, I enclose the entire article in a div with a maximum width of 800px.
However, images can be wider than 800px and should be displayed at their full size if possible.
The requirements are more formal:
<div style="max-width: 800px;">
<p>
Какой-то текст. Какой-то текст.
</p>
<p id="p_img">
<img id="wide_img" src="/img.jpg" alt="Изображение размером 1024x768"/>
</p>
<p>
Какой-то текст. Какой-то текст.
</p>
</div>
Answer the question
In order to leave comments, you need to log in
Why didn't you say right away that you were typing a letter? :)
This categorically changes the question.
In principle, it is impossible to implement your task for all mail clients and web interfaces.
As an argument: the max-width property only works in gmail. So my advice is to design a layout that does not contain rubber pictures.
And also there should not be background images, because they work just as far from everywhere.
habrahabr.ru/post/112163/
habrahabr.ru/post/113709/
habrahabr.ru/post/114119/
habrahabr.ru/post/114234/
habrahabr.ru/company/unisender/blog/115962/
habrahabr.ru/post/ 117613/
habrahabr.ru/post/127266/
habrahabr.ru/post/127403/
habrahabr.ru/post/137978/
Enjoy reading. Everything is dedicated to html letters.
Faced a similar problem for the arrows in the carousel, depending on the screen resolution.
Did it with jQuery.
Here is the code, but you will need to add it yourself, you will easily understand and handle it:
<script language="JavaScript">
$(document).ready(function(){
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
if($(window).width()<900) {
}
$(window).resize(function() {
if($(window).width()<900) {
показываем маленькую картинку
}
if($(window).width()>=900) {
показываем большую картинку
}
});
});
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question