Responsive IFRAME
Coduri intrebari, probleme legate de HTML, XHTML si CSS
-
MarPlo
- Administratorul site-ului
- Mesaje: 4332
Responsive IFRAME
Acest cod html /css poate fi utilizat pentru a face responsive elemente <iframe> din pagina, atat pe lungime cat si inaltime. Se vor auto-redimensiona dupa marimea ferestrei browserului.
- HTML:
Cod: Selectaţi tot
<div class="youtube">
<iframe src="https://www.youtube.com/embed/x1USgMp9__s?autoplay=0"></iframe>
</div>
- CSS:
Cod: Selectaţi tot
.youtube {
margin:8px auto 5px auto;
position:relative;
padding-bottom:12%;
padding-top:100px;
height:0;
overflow: auto;
-webkit-overflow-scrolling:touch;
text-align:center;
width:99%;
max-width:600px;
min-width:300px;
min-height:205px;
}
.youtube iframe {
border:0;
display:block;
margin:0 auto;
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
max-height:420px;
min-height:200px;
}
Subiecte similare
-
Responsive Divs cu flexbox
HTML - XHTML - CSS
Primul mesaj
Salutare, am tot incercat sa ma uit pe diverse exemple insa nu gasesc imi trebuie mie. In mod normal lucrez doar in back-end. Am de facut o pagina...
Ultimul mesaj
Mutumesc Marplo. Codul postat de tine functioneaza perfect, insa probabil nu am stiut eu sa explic de vreau.
Postez si solutia gasita de mine, ideea...