Here’s the demo.<\/a><\/p>\nHere’s a video:<\/p>\n<\/video><\/figure>\n","protected":false},"excerpt":{"rendered":"Viewport units are things like 10vw (10% of the viewport width) or 2vh (2% of the viewport height). Useful sometimes, as they are always relative to the viewport. No cascading or influence by parent elements. There is also vmin, which is the lesser of vw and vh, and vmax, which is the greater. These values […]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[4],"tags":[1177,1176,1175],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":305453,"url":"https:\/\/css-tricks.com\/css-viewport-units\/","url_meta":{"origin":252564,"position":0},"title":"CSS Viewport Units","date":"March 25, 2020","format":false,"excerpt":"Deep dive from Ahmad. I like the coverage of vmin and vmax, which I think I don't reach for as often as I should. I'm thinking that if you are doing something highly directional (e.g. a full bleed trick), then directly using vw is necessary. On the other hand, if\u2026","rel":"","context":"In "Link"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2020\/03\/vmin-vmax-units.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":252583,"url":"https:\/\/css-tricks.com\/fun-viewport-units\/","url_meta":{"origin":252564,"position":1},"title":"Fun with Viewport Units","date":"June 5, 2017","format":false,"excerpt":"Viewport units have been around for several years now, with near-perfect support in the major browsers, but I keep finding new and exciting ways to use them. I thought it would be fun to review the basics, and then round-up some of my favorite use-cases. What are viewport units? Four\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":303699,"url":"https:\/\/css-tricks.com\/centering-a-div-that-maintains-aspect-ratio-when-theres-body-margin\/","url_meta":{"origin":252564,"position":2},"title":"Centering a div That Maintains Aspect-Ratio When There’s Body Margin","date":"February 18, 2020","format":false,"excerpt":"Andrew Welch had a little CSS challenge the other day to make an ordinary div: \u2022 centered vertically + horizontally\u2022 scales to fit the viewport w\/ a margin around it\u2022 maintains an arbitrary aspect ratio\u2022 No JS There's a video in that tweet if it helps you visualize the challenge.\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/09\/aspect-ratio.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":346316,"url":"https:\/\/css-tricks.com\/the-large-small-and-dynamic-viewports\/","url_meta":{"origin":252564,"position":3},"title":"The Large, Small, and Dynamic Viewports","date":"August 9, 2021","format":false,"excerpt":"We've got viewport units (e.g. vw, vh, vmin, vmax), and they are mostly pretty great. It's cool to always have a unit available that is relative to the entire screen. But when you ask people what they want fixed up in CSS, viewport units are always on the list. The\u2026","rel":"","context":"In "Link"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/08\/viewports-teaser.png?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":20734,"url":"https:\/\/css-tricks.com\/theres-more-to-the-css-rem-unit-than-font-sizing\/","url_meta":{"origin":252564,"position":4},"title":"There\u2019s more to the CSS rem unit than font sizing","date":"March 22, 2013","format":false,"excerpt":"Many web designers and developers are familiar with the CSS rem length unit. But, you may not know that it has a couple of handy alternate uses. In this post, I\u2019ll describe how to use the CSS rem unit to scale specific page elements while leaving others unaffected. I\u2019ll also\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20529,"url":"https:\/\/css-tricks.com\/the-lengths-of-css\/","url_meta":{"origin":252564,"position":5},"title":"The Lengths of CSS","date":"March 13, 2013","format":false,"excerpt":"There are quite a few properties in CSS that take a length as a value. The box model properties are the obvious ones: width, height, margin, padding, border. But plenty of others as well: the offset and sizing of a box-shadow or the size and spacing of fonts. What are\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"featured_media_src_url":null,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/252564"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=252564"}],"version-history":[{"count":3,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/252564\/revisions"}],"predecessor-version":[{"id":252572,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/252564\/revisions\/252572"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=252564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=252564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=252564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}