Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New MM #53

Open
mhulse opened this issue Jun 14, 2016 · 0 comments
Open

New MM #53

mhulse opened this issue Jun 14, 2016 · 0 comments

Comments

@mhulse
Copy link
Owner

mhulse commented Jun 14, 2016

/*
(media element width) / (media element height) = ratio
<div mm2>
    <!-- Default size, good for mobile viewing: -->
    <video width="300" height="169">...</video>
</div>
*/
[mm2],
.mm2 {
    height: 0;
    padding-top: 56.25%; /* 16:9 = (9 / 16 = .5625) x 100 */
    position: relative;
    overflow: hidden;
}
[mm2] > *,
.mm2 > * {
    border: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    position: absolute;
    top: 0;
    left: 0;
}
[mm2="theatre"],
.mm2.theatre { padding-top: 59.171597633136%; } /* 1.69:1 = (1 / 1.69 = .59171597633136) x 100 */
[mm2="slide"],
.mm2.slide { padding-bottom: 66.666666666667%; } /* 3:2 = (2 / 3 = .66666666666667) x 100 */
[mm2="tv"],
.mm2.tv { padding-bottom: 75%; } /* 4:3 = (3 / 4 = .75) x 100 */

http://aneventapart.com/news/post/laziness-in-the-time-of-responsive-design-by-ethan-marcotte-aea-video

@mhulse mhulse added the README label Mar 31, 2018
@mhulse mhulse added the Media label Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant