Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-scroll-snap/parsing/scroll-margin-valid.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin with valid values</title>
<meta name="assert" content="scroll-margin supports the full grammar '<length>{1,4}'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("scroll-margin-top", "0", "0px");
test_valid_value("scroll-margin-top", "-10px");
test_valid_value("scroll-margin-top", "calc(2em + 3ex)");
test_valid_value("scroll-margin-right", "0", "0px");
test_valid_value("scroll-margin-right", "-10px");
test_valid_value("scroll-margin-right", "calc(2em + 3ex)");
test_valid_value("scroll-margin-bottom", "0", "0px");
test_valid_value("scroll-margin-bottom", "-10px");
test_valid_value("scroll-margin-bottom", "calc(2em + 3ex)");
test_valid_value("scroll-margin-left", "0", "0px");
test_valid_value("scroll-margin-left", "-10px");
test_valid_value("scroll-margin-left", "calc(2em + 3ex)");
test_valid_value("scroll-margin", "0", "0px");
test_valid_value("scroll-margin", "-10px");
test_valid_value("scroll-margin", "calc(2em + 3ex)");
test_valid_value("scroll-margin", "1px 2px");
test_valid_value("scroll-margin", "1px 2px 3px");
test_valid_value("scroll-margin", "1px 2px 3px 4px");
test_valid_value("scroll-margin", "0 0 0 0", "0px");
</script>
</body>
</html>