EN
CSS - what is default display property value of HTML element?
1
answers
3
points
What is the default CSS display property value of HTML element?
I can't check it like this:
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<body>
<div id="my-element">My element</div>
</body>
<script>
var myElement = document.querySelector('#my-element');
console.log(myElement.style.display);
</script>
</html>
1 answer
3
points
Default value of the display property depends on the element type. In HTML, we have block and inline elements. So by default display property value is block or inline depending on the element.
Block elements:
divp- headers (
h1-h6) formsectionheaderfooter- etc.
Inline elements:
aspanimg- etc.
0 comments
Add comment