Home >Web Front-end >HTML Tutorial >Images can be automatically reduced in chrome and safari, but cannot be automatically reduced in firefox and IE9_html/css_WEB-ITnose
Because it needs to be accessible on mobile phones, the browser window was minimized during the test;
In Safari, it looks like this:
In Firefox, it looks like:
Neither the pictures nor the text are fully displayed;
The html and css are as follows:
<img class="img-responsive" width="250" src="img/sdlc.jpg" style="float:right;">
display:block;max-width:100%;height:auto
Try adjusting the width of the parent container
Try adjusting the width of the parent container
Or try html5, use different styles according to the browser width; however The browser is required to support Html5;
is similar to the responsive layout below;
<style type="text/css"> content div { border: 1px black solid; } @media screen and (max-width: 320px) { #below320 { background-color: red; } } @media screen and (min-width: 320px) and (max-width: 800px) { #between320to800 { background-color: red; } } @media screen and (min-width: 800px) and (max-width: 1280px) { #between800to1280 { background-color: red; } } @media screen and (min-width: 1280px) { #pass1280 { background-color: red; } }</style>
Change max-width:100% to width: 100%
These browsers will not work on mobile phones
Just remove the width
Change max-width:100% to width: 100%
These browsers can’t be used on mobile phones
Just remove the width.
If you remove the width, the image will be displayed at its original size and will not be reduced;
Or try html5, using different styles according to different browser widths; however, the browser must support Html5;
is similar to the responsive layout below;
<style type="text/css"> content div { border: 1px black solid; } @media screen and (max-width: 320px) { #below320 { background-color: red; } } @media screen and (min-width: 320px) and (max-width: 800px) { #between320to800 { background-color: red; } } @media screen and (min-width: 800px) and (max-width: 1280px) { #between800to1280 { background-color: red; } } @media screen and (min-width: 1280px) { #pass1280 { background-color: red; } }</style>
Change max-width:100% Change it to width: 100%
Have you removed width="250"?
This should be It is possible.
If it doesn’t work, it may be due to other influences.
Then I need to see more code.
This should be possible.
If it doesn’t work, it may be due to other influences.
Then I need to see more code.