Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Display: Text in display:contents keeps its style when the parent inline box changes style</title>
<link rel="match" href="display-contents-pass-green-no-red-ref.html">
<p>You should see the word PASS in green and no red below.</p>
<div><span id="inline" style="color: blue"><div style="display: contents; color: green">PASS</div></span></div>
<script>
document.body.offsetTop;
document.getElementById("inline").style.color = "red";
</script>