Css Aspect Ratio Width Equal To Height

If the stylesheet you link to has the file extension of a preprocessor, we'll attempt to process it before applying. The aspect ratio of a TV picture is the relationship between the width and height of the image. Sometimes, you may want or need to have all images (or videos, or inputs, etc. stretch: Scale width and height independently, This may change the aspect ratio of the src. The preserveAspectRatio attribute can also be used to control the scaling of images within SVG. For tires with aspect ratios less than 50 the factor is 0. A2 is twice the size of A3, and four times the size of A4. The RICG formulated, championed, and standardized the new HTML features presented in the article. Aspect ratio calculation formula: Aspect Ratio formula can be used in many ways in calculations. Why? It is a simple ratio between physical resolution and actual screen size (logical resolution) i. The best-performing version of the. See the Pen Giving font-size-adjust by Aakhya Singh on CodePen. 4142) as for the RA series sheets. Aspect ratio is the fractional relation of the width of a video image compared to its height. Anyways i found that it can only be achieved with img src and not from css. This tool resizes PNG images to any size. A 1:1 ratio means that an image’s width and height are equal, creating a square. We can stretch the image so that it fills the entire enclosing box. Defined as the ratio between the width and the height of a node e. By using a padding-based percentage, this will be a ratio of the element's width. a is the height, b is the width. However when designing, columns with equal heights — regardless of content — looks much cleaner and organised. For new Excel workbooks, the default row height for all the rows is 15, with the default font of Calibri and default font size of 11 points. Returns true if the settings objects are not of equal value, and false if they are of equal value. 26% (height 9 ÷ width 16) because this is the default ratio for YouTube videos. By using a padding-based percentage, this will be a ratio of the element’s width. , the physical length of axes height divided by its width. img-container2{ flex:1. A very common task used when creating images for a web site is to resize those images to have a fixed width and height. The naive way to adapt an image to a viewport is to set both the width and height of the image to match the viewport width and. So lets take a look at a effective way of make a web site screen size adjustable by using some great things in HTML and CSS. 25% of its own width, we can use the padding-top property with a percentage, which is proportional to its own width. an aspect ratio equal to the track header width/height. img: preserve aspect ratio but width and height="%". It is the width-to-height ratio of a film or television image. The formula is a simple ratio and proportion. Default value: see individual properties. Instead, the width and height get applied separately, and the image gets deformed. inherit: If specified, the associated element takes the computed value of its parent element background-size property. For an x:y aspect ratio, no matter how big or small the image is, if the width is divided into x units of equal length and the height is measured using this same length. CLASSIFICATION OF MICHELIN® TIRES 4 MICHELIN® EARTHMOVER TIRES TECHNICAL DATA BOOK H = 100 % S H = 80 % S 65 series The section width is expressed in inches or. With a viewBox specified, changing the height and width of the graphic will scale it rather than clip the SVG image. October 25, 2013 January 6, 2019 sunandabansal CSS Create a square div where height is equal to width and adjusts automatically You can do this with jquery (or pure javascript if you prefer). ) Browsers, though, can be resized at will. Example 1: This example describes the auto-resize image fit to div container. image/jpeg: video/mpeg, mpegversion=(int)4, systemstream=(boolean)false: video/mpeg, mpegversion=(int)2. This is where we need the calc() function because we have to mix units. Keeping Image Aspect Ratio. a is the height, b is the width. Please select an aspect ratio. Detects the ratio of value of the "device-width" media to the value of the "device-height" media. Sometimes, you may want or need to have all images (or videos, or inputs, etc. The aspect ratio of an image describes the proportional relationship between its width and its height. vmin → Equal to the smaller of vw or vh. With intrinsic dimensions, a new width triggers a new height calculation, allowing videos to resize and giving them the ability to scale the same way images do. When movies that were made in one aspect ra 10 are shown on televisions that have a different aspect ratio the picture doesn't match the size of the screen. Available in iOS 1. x core/tests/Drupal/Tests/Component/Utility/ImageTest. It involves trickery with padding such that an element's width and height are in proportion to your liking. aspect-ratio The ratio of the value of the width media feature to the value of the height media feature. Printing Landscape and Fit to Page. 2019-10-28T14:19:31Z Chrome Platform Status tag:www. There is likely a much more elegant way to do this, but what I've always done is something along these lines: 1) Let's assume that availableWidth and availableHeight define the target (fixed) area that you're resizing against. The height of your image was 400px and the width is 1200px but to maintain a correct aspect ratio the image would need to be around 900px natural height for a 1200px wide image (the page is 8. What are synonyms for aspect ratio?. For most computer screens the width of 1920 works just fine. The trick is, instead of explicitly controlling (and thus limiting) the height of the element, we set a known height on the floated pseudo element. By using a padding-based percentage, this will be a ratio of the element's width. js works, the aspect ratio is maintained by percentage padding based on the width of the parent element. Google for "auto resize youtube video" and you will find lots of sites explaining the traditional solution - Wrap the iframe in a new div with a bottom padding of 56. We float it left and leave it empty, producing a width of zero. 9 hours ago, OrganizedFellow said: I LOVE suckless tools. And to get it in the middle, we need to offset it from the left by half the viewport’s width (100vw/2) minus half the slide’s width (4/3*100vh/2). If the stylesheet you link to has the file extension of a preprocessor, we'll attempt to process it before applying. For a detailed tutorial on tag matching, see: CSS Tag Matching (Selector) Syntax. * * Conserve aspect ratio of the orignal region. The background image is resized so that its width or height (the bigger one) fits inside the element. Size dimension will be multiplied by this ratio. (the chart's ratio is 1. , the required FAR for this PAR. Slide 4 - Fit Height. It is portrait when the value of the height media feature is greater than or equal to the value of the width media. CSS Media Queries were originally a proposal submitted to the CSS Working Group by Opera Software and are now implemented in Firefox 3. A CSS library to easily apply aspect ratios. Or, it could be 1920 x 1080, 1280 x 720, or any other width/height combinations that can be calculated to equal 16:9. x core/tests/Drupal/Tests/Component/Utility/ImageTest. Both the width and height can be positive, negative, or zero. The image width has been reduced to the specified 12. The aspect ratio is the ratio between the width and the height of a display. At some point (on smaller browsers), your content may start to wrap and need more vertical space than your nice aspect ratio image will allow. If you put two such pages next to each other, or equivalently cut one parallel to its shorter side into two equal pieces, then the resulting page will have again the same width/height ratio. …pair of numbers (225/ 45R17) is the tire's aspect ratio or profile. The two most common aspect ratios in home video are 4:3 (also known as 4x3, 1. The RICG formulated, championed, and standardized the new HTML features presented in the article. background-size: 1 contain. In particular when working with responsive designs, you often want to be able to set the width to a percentage and have the height correspond to some aspect ratio. Now in the CSS file, first gave 0% width in the lists. by Adrien Zaganelli. Aspect Ratio Media Features. A page with width<=1mm or height<=1mm is considered invalid. The aspect ratio can then be expressed as width:height. , the physical length of axes height divided by its width. Enter a desired width for a 4:3 size video to get the width and height needed to maintain the aspect ratio when resizing your original video. The aspect ratio is the ratio formed when comparing the dimensions of a geometric figure. CSS Intrinsic Ratio Technique. In this JLabel-extending class, the real tricks are to override getPreferredSize and the paintComponent methods, where I do the image resizing. 'CSS' in window: tests whether the API is available as the CSS object. horizontal-align hue-rotation Sets the hue rotation to apply to the panel and all it's children during composition. So what we're looking into is having height: auto to adjust the image height correctly according to the width: 100%, without altering the image (aspect ratio) itself. The way I do it is to resize the image first to 1280 width keeping the aspect ratio for the height. The aspect ratio of your stitches is the ratio of the width and height of them. The 16:9 aspect ratio corresponds to a height which is 56. a is the height, b is the width. However, for small screens (like smartphones), you might want them to stack vertically instead of horizontally:. It can be any size or aspect ratio. max-height and max-width is used to. a Responsive design, means that your website/webapp should be readily fluid between a phone's portrait view to a 16:9, 4K desktop screen. Enter the values for the original width (W 1) & original height (H 1) on the left. Fix the hight of a column to a specific aspect ratio. "This classifier can recognize many kinds of rigid objects, once the appropriate classifier is trained. You can use a CSS syntax validator to check if your syntax is correct. Note that the CSS rule sets the WIDTH of the navigation DIV to 125px, but we placed an image inside the DIV itself that's 163px wide. LaTeX - Scale and change aspect ratio of PGFPlots tikzpicture. So padding-top: 100% gives you padding equal to the width of the element. However, the website is for an artist who obviously does not want the image to be altered in any way, especially not altering with the aspect ratio. The opposite is achievable by using a % value for padding-top, but padding-left as a percentage will be a percentage of the width of an object, not its height. The width of the image would be resized to 300, but the height would be calculated automatically based on the existing aspect ratio. A calendar is a block-level element that fills its entire avaiable width. 25% of the width (9 divided by 16 expressed as a percentage). Some common 1:1 ratios are an 8 x 8 inch photo, a 1080 x 1080 pixel image, or typically any profile picture template on social media sites (think Facebook). This aspect ratio is especially convenient for a paper size. This is why we’ve added an option called ‘Set Columns to Equal Height’ to the Fusion Builder’s versatile Container Element. Or, it could be 1920 x 1080, 1280 x 720, or any other width/height combinations that can be calculated to equal 16:9. Also a picture should not pixelate unless its native resolution is less than the size it is displayed. Use “auto” if you set a fixed height, to make sure the image is resized respecting the aspect ratio. Height equal to dynamic width (CSS fluid layout) 0 votes. The height media query's value is usually the width media query value divided by the screen's aspect ratio. Enter object-fit. WW refers to the width of the sidewall, while Htop and Hb refer to the thickness of the top plate and heat sink substrate respectively. Then the inside block will have padding-top as 50px. The padding of this one is the height of the video divided through its width, or in other words: the aspect ratio in percent! No matter how much you resize your window, it will always stay in this ratio. The columns we made in the previous example are responsive (if you resize the browser window in the try it example, you will see that they automatically adjust to the necessary width and height). HTML5 presentations that are set to. Ofcourse the same can be done with width to figure out the. Definition of Aspect Ratio in the Definitions. The stock 93 RX-7 tires were 225/50/16 (225mm section width, 50% aspect ratio, 16 inch wheel). Note: As the user resizes the window, Firefox switches style sheets as appropriate based on media queries using the width and height media features. For example parent block has width of 100px. Using this fact if you wrap each img tag into div tag and set its width to 100% of parent div then height will be according to aspect ratio as you wanted. 5:1, meaning that they are one and a half times as wide as they are tall. Then the inside block will have padding-top as 50px. This includes the command-line utilities, as well as the C and C++ APIs. Media queries can be added to a link HTML element:. The aspect-ratio feature is specified as a value representing the width-to-height aspect ratio of the viewport. always: details. Example with a 1:1 aspect ratio you can use a 1*1 transparent. , the required FAR for this PAR. I need to change the size of a PGFPlots tikzpicture in my LaTeX document. Read the report. An example of this is avatar images in user profiles or testimonials. Some of them. For more information on containing blocks and how its height is computed, see the Cascading Style Sheets, Level 2 (CSS2) specification. This allows you to not download/display the image on smaller (mobile) screens, via breakpoints, but have it behave like an html < img > and maintain it's aspect ratio responsively when you do show it. It defines its overall shape, and it is usually presented as W:H (where W is the width, and H is the height). 1 word related to aspect ratio: ratio. Here is a codepen:. Note: Although values are also CSS dimensions, and are usable in some of the same properties that accept values, they are not themselves values. The preserveAspectRatio attribute can also be used to control the scaling of images within SVG. height are taken with the device assumed to be in portrait mode for some reason, that is a current aspect ratio of 0. The rectangle is defined on the coordinate system of the sensor active pixel array, with (0,0) being the top-left pixel of the active pixel array. A calendar is a block-level element that fills its entire avaiable width. The concept#section2. Sizing Replaced Elements Using object-fit. 'CSS' in window: tests whether the API is available as the CSS object. The syntax of this attribute is preserveAspectRatio="align meetOrSlice". These two parameters describe the how an image is to fit. col-content. documentElement. Alternatively you can add a CSS class into. By using percentage, it will calculate the padding to use based on the width of the element. The final two values for the camera are the near and far clipping plane values. The padding of this one is the height of the video divided through its width, or in other words: the aspect ratio in percent! No matter how much you resize your window, it will always stay in this ratio. There should only ever be one row. If you use only one, than the package will adjust the other dimension so the image keeps the same aspect ratio. Tire specifications are generally composed of three numbers, the section width, aspect ratio, and rim diameter. If the aspect ratio of a picture were 1 to 1 (or 1:1), the width and height would be the same, and you'd have a square. Since a percentage of image width and height is specified, the browser can resize nearly any image and maintain its aspect ratio. The syntax of this attribute is preserveAspectRatio="align meetOrSlice". …pair of numbers (225/ 45R17) is the tire's aspect ratio or profile. Applying media queries. GPU is designed specifically for performing the complex mathematical and geometric calculations that are necessary for graphics rendering. reen Il Figure I shows a letterboxed image with an aspect ratio of 1 displayed on a screen with an aspect r TIO of 4:3- 8. But that's the thing, I don't want slick to set the fixed height on the container so my slide's images get resized keeping the aspect ratio properly, so when the width changes the height should change accordingly. Add this simple CSS code snippet to your Divi child theme to change the image aspect ratio of the featured image displayed in the Divi grid portfolio. I run into problems though with smaller images, if a user uploads a really small image, I would like it 'blown up' to a minimum of 200px. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself. To apply the CSS to an IMG SRC. Printing Landscape and Fit to Page. The first image is landscape (wider than it is tall), the second image is square (same width and height), and the last is portrait (taller than it is wide). Smart Quotes in HTML/CSS. Change the aspect ratio in the device entry if you want the software characters proportioned to fit the new aspect ratio. The "x-height" column gives the height of typical lowercase letters. This post is a followup to Bootstrap 3 Tips and Tricks You Might Not Know with even more tricks and tips. The images you end up using on the page may not have the same dimensions, let alone the same aspect ratio. It should returns an object containing width and height of the image. By using a padding-based percentage, this will be a ratio of the element's width. Holding the Shift key down forces the width-to-height aspect ratio of the selection to remain the same as you drag, which is what allows us to maintain the same aspect ratio as the original photo. You don't need to include frameborder="0" in your iframes. The meat of this trick is that according to the spec for margin-top, a percentage refers to the width of the containing block, not the height. The second half is a hack for IE, which doesn't. The section width is expressed in inches followed by the number 90. by increasing the width without adjusting the height accordingly). Here is a quick tip for creating responsive elements that retain their aspect ratio as they scale. mySelector { width: 100%; height: auto; } Ensure this style rule applies to an image element, andthat's all there is to it. The aspect ratio of an image is its width divided by its height. stretch: Scale width and height independently, This may change the aspect ratio of the src. B Paper Sizes were formed to name the Sizes that didn't come in A Series. Using this unit, it is easy to create full-height containers:. (Aspect ratio is the ratio between height and width. Using this option, allows for use with a greater range of images. Then padding will be the only part of the box model affecting the height, and we'll have our square. Font aspect values are calculated by dividing the lowercase x-height of the font by the font size. The second example specifies a percentage of original image size, both width and height, instead of size in pixels. Selecting a color should be as easy as moving a slider, clicking a checkbox or pressing a key just like other basic form elements behave. It is based on the padding property that, when its value is in percent, is proportional to parent width, even for padding-top and padding-bottom. Consider using css-aspect-ratio or Aspect Ratio Boxes to help preserve aspect ratios. We created a block inside it and specified its padding-top to be 50%. CSS3 Media Queries enable you to target your CSS as generally or as specifically as you like. Finally, min-and max-height provide a range for the image sizing. Common aspect ratios in photography. These images may have different aspect ratios, but for the layout to look good I want them to have the same height and also fill the complete width, with possibly some white space between the images. Maintain Aspect Ratio for HTML Element Using Only CSS in a Responsive Design There is an easy way to make a div or other element square or any other shape while still being responsive, using ONLY CSS. When working with aspect ratios in most modern design projects, an aspect ratio will have a horizontal orientation, because most screens are wider than they are tall. vmin → Equal to the smaller of vw or vh. CSS Flexbox Style Equal Height Plugin For jQuery - equalHeight. Custom Screen Size Calculator. The height/width in plotOutput correspond with CSS height/width, and height="100%" generally doesn't do what you want it to in HTML/CSS. # Do not use JavaScript for responsive iframes. Specifies the transformation to use when converting the logical size specified in the current document rasterization options to the final physical raster image size. Thus, a long, narrow wing has a high aspect ratio, whereas a short, wide wing has a low aspect ratio. The ratio of width to height of standard-definition television In mathematics, a ratio indicates how many times one number contains another. Firstly, the set value of either the Width or the Height is adjusted to give the desired DAR, i. The CSS height property is used to specify the height of an element. 78:1, or wide-screen). The ‘aspect ratio hack’. There may be instances when you are viewing a video on a mobile site or a responsive web page and the video appears with black bars on the side or won't fit the layout. (the chart's ratio is 1. reen Il Figure I shows a letterboxed image with an aspect ratio of 1 displayed on a screen with an aspect r TIO of 4:3- 8. Aspect ratio calculation formula: Aspect Ratio formula can be used in many ways in calculations. The 4:1 minimum length-to-width (i. No matter the width of the viewport, the child div will keep its aspect ratio (100% / 20% = 5:1). Size dimension will be multiplied by this ratio. Two common video aspect ratios are 4:3 and 16:9. SVG as image with an intrinsic width and max-height has its width incorrectly scaled down by the same ratio as the height is scaled down has incorrect default size in vertical writing mode; Specifications covered: CSS Backgrounds; CSS Images. The height/width in plotOutput correspond with CSS height/width, and height="100%" generally doesn't do what you want it to in HTML/CSS. The trick is, instead of explicitly controlling (and thus limiting) the height of the element, we set a known height on the floated pseudo element. In the htmlI still specify the image width and height in px and I also add image {height: auto} in my css. The naive way to adapt an image to a viewport is to set both the width and height of the image to match the viewport width and. Using the intrinsic ratio technique allows the browser to determine video dimensions based on the width of the parent container. All fonts have an aspect ratio (or value). You can apply CSS to your Pen from any stylesheet on the web. a low aspect ratio). This post is a followup to Bootstrap 3 Tips and Tricks You Might Not Know with even more tricks and tips. AutoSize enum. I recently set up a machine with Linux again to find out if I could establish a more solid workflow than on Windows. 58, then you would use font-size-adjust: 0. 5-inch diagonal. Antonyms for aspect ratio. When my css set the canvas to 100% of its container, it made the rendered size a different aspect ratio than the canvas’ inner drawing surface. The stock 93 RX-7 tires were 225/50/16 (225mm section width, 50% aspect ratio, 16 inch wheel). On a device with screen resolution 1280x720, the following device-aspect-ratio values would all match it (multiples of 1280x720):. * * Conserve aspect ratio of the orignal region. The traditional TV screen has a width to height (aspect) ratio of 4:3 - that means that for every 3 inches in TV screen height, there will be 4 inches of TV screen width. When a user updates the width field I get the adjusted height like so: aspect ratio = original width ÷ original height adjusted height = ÷ aspect ratio Is this correct?. The aspect ratio represents the percentage of width to height. A calendar is a block-level element that fills its entire avaiable width. A CSS inch is exactly or 'close' to an inch. 'supportsCSS' in window: tests whether the API is available using supportsCSS() instead; Try atsupports. This calculator will compute all the resolutions that something can be scaled down in correctly. I did some searching and found a CSS workaround to keep the aspect ratio of a fluid element by ansciath. The pixel aspect calculator makes it extremely easy to change any "W:H" format with custom a width or height. Black bars of equal width are used to fill in the rest of the screen. : min-width, max-width, min-aspect-ratio, max-aspect-ratio,…) In the following simple example, the default background color is hotpink , but screen devices with a viewport width that’s 650px or less will have a background color of. The Tessarray constructor takes three arguments, a containerSelector string, a boxSelector string, and an optional options object. equalHeight. 90% of CSS can be mastered in just a day. The aspect ratio of an image describes the proportional relationship between its width and its height. If I wanted the height to be exactly 4 inches, I could change the Height value to 4 inches, which would then change the Width to 6. It's a good fact to note if you're doing CSS work. Keeping Image Aspect Ratio. Find changesets by keywords (author, files, the commit message), revision number or hash, or revset expression. The final two values for the camera are the near and far clipping plane values. Here is the code:. Android: proportionally stretch an ImageView to fit the whole screen width while maintaining its aspect ratio February 21, 2015 February 24, 2015 - by Ryan - 7 Comments. Currently, with STYLE, I can use width: 100% and auto on the height (or vice versa), but I still can't constrain the image into a specific position, either being too wide or too tall, respectively. 5 times as long as the short side. This is especially useful for embeded content, like videos. js, written by yours truly. When a user updates the width field I get the adjusted height like so: aspect ratio = original width ÷ original height adjusted height = ÷ aspect ratio Is this correct?. Rachel Andrew says that the CSS Working Group designed an aspect ratio unit at a recent meeting. The "x-height" column gives the height of typical lowercase letters. Aspect ratio is a non-standard property only available in React Native and not CSS. (useful when space is an issue)}} Note that the image will always retain its aspect ratio. So lets take a look at a effective way of make a web site screen size adjustable by using some great things in HTML and CSS. For most computer screens the width of 1920 works just fine. (The measure given is the length of the diagonal across the. Take a look at the image bellow:. Sizing Replaced Elements Using object-fit. Leave the Size and Position box open so it’s handy for the next picture. Pinterest has often emphasized that the optimal shape is 2:3, or 1 1/2 times taller than wide. For img tags if you define one side then other side is resized to keep aspect ratio and by default images expand to their original size. You don't need to include frameborder="0" in your iframes. 70 giving an answer of 10. Tag Syntax Script Syntax. It contains nothing but two numbers, the page width, and page height, and a few utility functions that convert page sizes to pixel sizes and to compute the aspect ratio. If mode is Qt. So how I can figure out the a relation between the font size and the line width? all what I know here is the line width is significantly greater than the line height, and thats a good. Aspect Ratio Calculator This tool will help you calculate aspect ratios and pixel dimensions of images and videos. CSS Media Queries — is a technique that allows you to apply CSS-rules based on devices properties such as screen size, orientation, etc. Example with a 1:1 aspect ratio you can use a 1*1 transparent. More specifically, media queries enable you to apply different styles depending on the browser window width, device screen width, type of device, aspect ratio and pixel ratio. : min-width, max-width, min-aspect-ratio, max-aspect-ratio,…) In the following simple example, the default background color is hotpink , but screen devices with a viewport width that’s 650px or less will have a background color of. Maintain div aspect ratio according to height. Select Maintain Aspect Ratio to ensure that the images are not skewed. So padding-top: 100% gives you padding equal to the width of the element. x core/tests/Drupal/Tests/Component/Utility/ImageTest. Here is the generic component I have been using to make an arbitrary container who's height is always in a particular ratio to its width. Dynamic Width Elements. We call this a fluid aspect ratio. CSS padding-top property. The aspect ratio of a TV picture is the relationship between the width and height of the image. HTML and CSS have been designed around 96 dots (or pixels) per inch as the standard unit of measure. Media types. You can easily visualize any aspect ratio by allocating units to the width and the height of an image. By using percentage, it will calculate the padding to use based on the width of the element. Aspect ratio is simply a term to describe the proportional relationship between the width and height of any image. It contains nothing but two numbers, the page width, and page height, and a few utility functions that convert page sizes to pixel sizes and to compute the aspect ratio. Example: QSizeF t1( 10 , 12 ); t1. @media screen and (max-width: 300px) { /*write your css in this code block*/} Looking at it, you can almost guess what that does. Photoshop automatically sets the Height to 4 inches, or in this case, to 3. A calendar is a block-level element that fills its entire avaiable width. If you click the save button, your code will be saved, and you get an URL you can share with others. Make Iframe Responsive While Preserving Aspect Ratio. If the image doesn’t animate, then you should set the image width in CSS or via the width attribute. Two common video aspect ratios are 4:3 and 16:9. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML. The aspect ratio of the images is maintained. For example, if the aspect ratio of the video embed is 16:9, the padding-bottom percentage should be 9 divided by 16 (. From the CSS Specification, cover is defined to: Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and. Media queries is a CSS3 module allowing content rendering to adapt to conditions such as screen resolution (e. width / height, a value of 1 representing a square canvas). The resolution of an image is the total. Note: As the user resizes the window, Firefox switches style sheets as appropriate based on media queries using the width and height media features. 25%; This doesn't create a completely smooth scale-down though - notice how when the browser window is pulled-in, only the banner image width shrinks to begin with, until it hits the padding-top/aspect ratio threshold, and then the height is affected too. The first half of that style is for browsers that support the max-width and max-height properties -- Chrome, Firefox, Opera, and Safari. 7 cm width, and the height has been adjusted proportionately to 7. htmlect="expression". Google for "auto resize youtube video" and you will find lots of sites explaining the traditional solution - Wrap the iframe in a new div with a bottom padding of 56. A proper ratio to maintain the image quality.