Am I mistaken in believing that the <details> element is not a block level element?

I want to know for sure if <details>- a block level element. The reason I ask is this:

and

  1. The specification in No. 3 has code for <details>. When you open this Codepen in Firefox (54.0.1) and check the element <details>, it is inline, but when you open the same Codepen in Chrome (59.0.3071), the same element is set as blockon the User Agent table.

Is the element <details>inline or blocky or browser dependent?

+4
source share
2 answers

An element <details>behaves like a block level element. To check this, I opened jsfiddle, added an element <details>and inspected it. I was also able to set it to the line just fine.

Microsoft Edge , .

EDIT: Firefox, Firefox , .

+2

- :

<span><details></details></span>

... W3C HTML Validator :

details , span .

, details:
    .
span:
    .

, , .

, / HTML, . HTML5, CSS3 , .

+1

Source: https://habr.com/ru/post/1681973/


All Articles