Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-images/object-fit-contain-svg-zero-height.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>'object-fit: contain' on an SVG with a height of 0 uses its viewBox's aspect ratio</title>
<link rel="match" href="object-fit-contain-svg-zero-height-ref.html">
<style>
img, object {
float: left;
width: 100px;
height: 100px;
margin-right: 10px;
object-fit: contain;
}
</style>
<img src="support/svg-width-100-height-0-viewBox-2-1-green.svg">
<object data="support/svg-width-100-height-0-viewBox-2-1-green.svg"></object>