Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-sizing/stretch/auto-margins-1.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="help"
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<script src="/resources/check-layout-th.js"></script>
<meta name="assert"
content="auto margins are treated as 0 in basic horizontal centering cases">
<body onload="checkLayout('[data-expected-width]')">
<div style="width: 100px; position: relative; border: solid">
<div style="margin: 0 auto; width: stretch; background: lime;"
data-expected-width="100" data-offset-x="0">lorem</div>
</div>
<div style="width: 100px; position: relative; border: solid">
<div
style="margin: 0 auto; min-width: stretch; width: 25px; background: lime;"
data-expected-width="100" data-offset-x="0">lorem</div>
</div>