TAG
CSS
JavaScript
Result
Run
License
<h1 id="title" style="color: #0000FF; font-weight: normal;"> How many CSS inline properties? </h1> <p></p> <p></p>
#title { position: relative; display: inline-block; } #title::after { content: "click me"; position: absolute; padding: 7px; border-radius: 50%; background: #000; color: #FFF; font-size: 15px; top: -20px; right: -70px; } #title::before { content: ""; position: absolute; display: inline-block; width: 10px; height: 10px; background: #000; transform: rotate(70deg); top: 3px; right: -30px; }
window.addEventListener("load", function() { var title = document.getElementById("title"); title.onclick = function() { document.querySelector("p:nth-of-type(1)").textContent = "Total: " + this.style.length; document.querySelector("p:nth-of-type(2)").textContent = this.style.cssText; }; });
Console
expand_less
License
License
by DevDic
Close