Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>CSS Borders Test: border-shape with geometry box</title>
<link rel="match" href="border-shape-geometry-box-ref.html">
<style>
body {
margin: 0;
}
.container {
display: inline-block;
background: yellow;
}
.test {
width: 100px;
height: 100px;
background: thistle;
padding: 10px;
margin: 10px;
border: 10px solid palegoldenrod;
}
.contents {
width: 100%;
height: 100%;
background: lightblue;
}
#margin-border {
border-shape: polygon(0 0, 100% 0, 100% 100%, 0 100%) margin-box polygon(0 0, 100% 0, 100% 100%, 0 100%) border-box;
}
#border-padding {
border-shape: polygon(0 0, 100% 0, 100% 100%, 0 100%) border-box polygon(0 0, 100% 0, 100% 100%, 0 100%) padding-box;
}
#padding-content {
border-shape: polygon(0 0, 100% 0, 100% 100%, 0 100%) padding-box polygon(0 0, 100% 0, 100% 100%, 0 100%) content-box;
}
#margin-content {
border-shape: polygon(0 0, 100% 0, 100% 100%, 0 100%) margin-box polygon(0 0, 100% 0, 100% 100%, 0 100%) content-box;
}
</style>
<div class="container">
<div class="test" id="margin-border">
<div class="contents"></div>
</div>
</div>
<div class="container">
<div class="test" id="border-padding">
<div class="contents"></div>
</div>
</div>
<div class="container">
<div class="test" id="padding-content">
<div class="contents"></div>
</div>
</div>
<div class="container">
<div class="test" id="margin-content">
<div class="contents"></div>
</div>
</div>