Skip to content

Truly independent web browser

1.2 KB
Raw Blame
<!DOCTYPE html>
<link rel="match" href="../expected/inline-background-image-slice-ref.html">
<style>
@font-face {
    font-family: Ahem;
    src: url("../data/fonts/Ahem.ttf");
}

body {
    margin: 0;
    font: 20px/20px Ahem;
    color: transparent;
}

.case {
    width: 200px;
    height: 100px;
}

/* With box-decoration-break: slice, the background image of the span is laid out once, over its two pieces placed
   end to end in the inline direction, so the square only shows at the end of the strip, in the second piece. */
span {
    background-image: linear-gradient(lime, lime);
    background-size: 10px 10px;
    background-repeat: no-repeat;
}

.ltr {
    padding-right: 10px;
    background-position: right center;
}

/* Right to left, the first piece takes the right end of the strip, so its left end is in the second piece. */
.rtl {
    padding-left: 10px;
    background-position: left center;
}

.vertical {
    padding-bottom: 10px;
    background-position: center bottom;
}
</style>
<div class="case"><span class="ltr">XXXX<br>XXXX</span></div>
<div class="case" dir="rtl"><span class="rtl">XXXX<br>XXXX</span></div>
<div class="case" style="writing-mode: vertical-lr"><span class="vertical">XXXX<br>XXXX</span></div>