Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<title>CSS Test: changing 'object-view-box' on an SVG document in &lt;object&gt; after it loads (reference)</title>
<link rel="author" title="Sam Weinig" href="mailto:sam@webkit.org">
<style>
.box {
position: relative;
float: left;
width: 48px;
height: 32px;
border: 1px solid gray;
padding: 1px;
}
.content {
position: absolute;
left: 1px;
top: 1px;
width: 48px;
height: 32px;
overflow: hidden;
}
.content > div {
position: absolute;
}
</style>
<div class="box"><div class="content">
<div style="background: blue; left: 8px; top: 0px; width: 32px; height: 16px"></div>
<div style="background: black; left: 40px; top: 0px; width: 32px; height: 16px"></div>
<div style="background: rgb(255,128,128); left: 8px; top: 16px; width: 32px; height: 16px"></div>
<div style="background: lime; left: 40px; top: 16px; width: 32px; height: 16px"></div>
</div></div>
<div class="box"><div class="content">
<div style="background: blue; left: 0px; top: -2px; width: 24px; height: 12px"></div>
<div style="background: black; left: 24px; top: -2px; width: 24px; height: 12px"></div>
<div style="background: rgb(255,128,128); left: 0px; top: 10px; width: 24px; height: 12px"></div>
<div style="background: lime; left: 24px; top: 10px; width: 24px; height: 12px"></div>
</div></div>
<div class="box"><div class="content">
<div style="background: blue; left: 16px; top: 12px; width: 8px; height: 4px"></div>
<div style="background: black; left: 24px; top: 12px; width: 8px; height: 4px"></div>
<div style="background: rgb(255,128,128); left: 16px; top: 16px; width: 8px; height: 4px"></div>
<div style="background: lime; left: 24px; top: 16px; width: 8px; height: 4px"></div>
</div></div>