Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html dir="ltr">
<head>
<link rel="match" href="dir-pseudo-update-document-element-ref.html">
<script>
document.documentElement.setAttribute('dir', 'rtl');
</script>
<style>
div {
width: 100px;
height: 100px;
float: left;
}
div:dir(rtl) {
background-color: green;
}
div:dir(ltr) {
background-color: red;
}
</style>
</head>
<body>
<div></div>
</body>
</html>