Source code

Revision control

Copy as Markdown

Other Tools

<!doctype html>
<title>Tests whether safe alignment works correctly on the anchor element.</title>
<style>
body {
direction: rtl;
display: inline;
}
.anchor {
position: fixed;
top: 0px;
right: 0px;
height: 30px;
color: white;
background-color: green;
}
.infobox {
color: darkblue;
background-color: azure;
border: 1px solid #ddd;
padding: 10px;
position: fixed;
top: 35px;
right: 0px;
}
.anchor2 {
position: fixed;
top: 0px;
right: 390px;
width: 100px;
height: 30px;
color: white;
background-color: green;
}
.infobox2 {
color: darkblue;
background-color: azure;
border: 1px solid #ddd;
padding: 10px;
position: fixed;
top: 0px;
right: 495px; /* This value is calculated from the right position value of .anchor2 plus its width, plus an additional 5 px of padding */
}
</style>
<div style="position: relative;">
<div class="anchor">Anchor</div>
<div class="infobox">
<p>Anchored element with justify-self</p>
</div>
<div class="anchor2">Anchor</div>
<div class="infobox2">
<p>Anchored element with align-self</p>
</div>
</div>