WebSite X5Help Center

 
Bjorn Andreassen
Bjorn Andreassen
User

IFRAME and width  en

Autor: Bjorn Andreassen
Visited 1437, Followers 1, Udostępniony 0  

How can I set different widths for IFRAME in different Viewport?

Example:

  • 70% width for desktop
  • 100% width for mobile
Posted on the
2 ODPOWIEDZI - 1 PRAWIDłOWA ODPOWIEDź
ANI B.
ANI B.
User

Hello Bjorn

Look when you create an iframe for your website then it will be automatically adjusted to mobile. Take an example

Your Desktop viewport is 1280 and Mobile viewport is 320.

If you want to insert two or 3 iframes in one coloumn of your project and set a width of 425 for each then it will be automatically adjusted for mobile.

If you want several percentage for your iframe on desktop then you have to adjust your iframe width according to your viewport

Thank you

Czytaj więcej
Posted on the from ANI B.
Bjorn Andreassen
Bjorn Andreassen
User
Autor

Fix for my problem:

<style>
@media screen and (min-width: 1200px) { 
 .colum {     
      width: 60%;
    }
}
@media screen and (max-width: 1024px) {  
.colum {      
    width: 100%;
    }
}
</style>

<div class="colum">
</div>

Czytaj więcej
Posted on the from Bjorn Andreassen