mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
150 stars 142 forks source link

Misleading div description #3943

Closed browsermage closed 3 years ago

browsermage commented 3 years ago

Request type

Details

I think the starting description of div is misleading, the text I am talking about is:

It has no effect on the content or layout until styled using CSS.

With things like display:flex and more it can easily have an impact on the flow of the layout even without CSS applied.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div

Thank you for your time.

chrisdavidmills commented 3 years ago

Hi @Kaffesumpen !

With things like display:flex and more it can easily have an impact on the flow of the layout even without CSS applied.

But ... display: flex is applied CSS. Am I missing something here? The key to this is that without any CSS applied to the page at all, <div> elements don't have any semantic value or influence the visual layout of the page.

browsermage commented 3 years ago

Sorry if I made a bad description. If you have a parent element with display:flex adding a div will change the layout depending on what the flex parent have set.

The key to this is that without any CSS applied to the page at all ...

With this I agree but that is not how I read it. I read it as long as the div do not have styles applied to it nothing happens, but a parent element can have display: flex and other layout properties that are not inherited that applies to that div even if the div is not directly styled, and those will have layout implications.

chrisdavidmills commented 3 years ago

@Kaffesumpen ah, I see what you're getting at now. I've updated the sentence in question:

https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/div

Does that solve this issue, do you think?

browsermage commented 3 years ago

Yes, thanks for a great resource.

chrisdavidmills commented 3 years ago

Yes, thanks for a great resource.

Cool, glad I could be of help.