You can use images like background in Divs and use media-query to adjust, an example if you have two images:
<style>
.banner-1 {
background: url(images/normal/banner1.jpg);
display: inline-block;
width: 978px;
height: 90px;
}
.banner-2 {
background: url(images/normal/banner2.jpg);
display: inline-block;
width: 500px;
height: 50px;
}
@media (max-width: 420px) {
.banner-1 {
background-image: url(images/celular/banner1.jpg);
width: 230px;
}
.banner-2 {
background-image: url(images/celular/banner2.jpg);
width: 100px;
height: 10px;
}
}
</style>
<div class="banner-1"></div>
<div class="banner-2"></div>
Adjust the @media (max-width: 420px)
for what you find suitable for the screen of mobile phones, already the swf
there would be no way to trade, but usually the swf itself can be exploited, so simply add it width: 100%;
to adjust to the DIV element that receives the width:
and height
of media-query for example, however I must warn you that Google Chrome and Firefox already block files by default swf
(I believe you can activate or still have the click to play, but it is something that will really only work depending on the user, flash is no longer a good way in time)
I think this idea will work for you https://answall.com/questions/57828/mudar-banner-deacordo-com-tamanho-de tela
– user60252
I saw here, but I could not understand where I direct the files in these codes.
– jhonatan santos
There are a multitude of screen sizes, it would not be better to already detect whether it is mobile or not and insert the corresponding file?
– user60252
That !!! because I want to talk to you to be understood and I end up being in the way. , I seek a code that helps me in this, that when accessing on the phone it looks for the file x , and when accessing on the pc it looks for the file y
– jhonatan santos
It would be something like this, but I can’t imagine what to call or say which file it should call when it is in this dimension. @media(max-width: 500px){ . text{ font-size: 10px; color: black; } } ignore the code, just one example
– jhonatan santos
Uai, the question is to change ( jpeg , gif or swf ) according to screen size, and in the comment it is a CSS
– user60252
yes change, regardless of how to do.
– jhonatan santos