27 ms·
When comparing the articles for <div> on MDN and W3Schools they look rather similar. Both show that a div can get styled by using class or id. But MDN is a lot
by Yaina 5y ago
When comparing the articles for <div> on MDN and W3Schools they look rather similar. Both show that a div can get styled by using class or id. But MDN is a lot more careful in their wording and gives important context.
W3Schools writes:
> The <div> tag defines a division or a section in an HTML document.
From a semantic perspective this is not true or it's at least misleading. <div> does not define a section or division, that's what <section> or <article> is for.
The MDN article in contrast calls a div a "generic container" and has a disclaimer that says.
> The <div> element should be used only when no other semantic element (such as <article> or <nav>) is appropriate.
And while W3Schools does not say "div is a cool box", they instead write "Any sort of content can be put inside the <div> tag!", which...yeah.
- rainonmoon 5y agoThat final line comes after the aforementioned explanation, not in place of it as OP suggests. The point, as many others have offered in this thread but those set on hating W3Schools at all costs are determined to ignore, is that they provide a succinct explanation of web technologies for the relative layman. Its existence doesn't detract from MDN or any other resource, meanwhile it provides a demonstrable service. That seems like an odd crime to warrant strawmen attacks.