This technique allows you to make embedded videos responsive.
You now know one of the most complex concepts in CSS Grid, so give yourself a pat on the back.
So the columns will now always be at least 100px.Heres the final CSS.container display: grid; grid-gap: 5px; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr grid-template-rows: repeat(2, 100px Notice that all the responsiveness happens in a single line of CSS.For example: @media (min-width: 768px) targets tablets @media (max-width: 767px) doesnt target tablets Previous CSS transform Next Sass.Simply by writing your html code, youre already designing your mobile website.It does so by targetting devices with your CSS and applying certain styles on these devices only.A website is how to make churros in the oven responsive if it is able to adapt to the screen of the client.
This is a more powerful way of specifying your columns and rows.
But designing the mobile version first is actually easier considering a html is almost 100 responsive out of the box.
They work almost identically to the em unit, but are relative to the html element, geschenke für künstler which make them a lot easier to use than ems.Without knowing the aspect ratio of the iframe, its not easy to implement the intrinsic ratio technique.The html: div class"video-container" iframe width"800" height"450" /div And now, the CSS:.video-container position: relative; padding-bottom:.25; padding-top: 30px; height: 0; overflow: hidden;.video-container iframe,.video-container object,.video-container embed position: absolute; top: 0; left: 0; width: 100; height: 100; Once you applied this code to your website, embedded videos.The CSS3 specification included a new unit named rems.How high is the viewport?YouTube and, vimeo will provide you a snippet of code like the one below: iframe width"560" height"315" src"m/embed/KMYrIi_Mt8A" Notice I removed the frameborder attribute.Now, lets focus on a very important aspect of a modern website: medias, such as videos or images.Your iframe should now proportionally resize based on the browser size.