Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Article element in a wrong implementation #2614

Open
Amer-Adel opened this issue Sep 13, 2023 · 5 comments
Open

Article element in a wrong implementation #2614

Amer-Adel opened this issue Sep 13, 2023 · 5 comments
Labels
Content:HTML issues related to HTML examples. idle Issues and pull requests with no activity for three months. nit

Comments

@Amer-Adel
Copy link

Amer-Adel commented Sep 13, 2023

MDN URL

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

What specific section or headline is this issue about?

Try it

What information was incorrect, unhelpful, or incomplete?

each day’s forecast (<article class="day-forecast">) doesn’t make sense on its own and is too dependent on the main forecast (<article class="forecast">), then it might not be appropriate to use the <article> tag for the individual day forecasts.

Instead, you can put the name of the city in each sub article but this lead to lots of repetition, so you could consider using the <section> tag for each day’s forecast, as it is used to group related content. If the individual forecasts are not intended to stand alone and are part of a larger whole (the main forecast), then the <section> tag would be more appropriate.

What did you expect to see?

<article class="forecast">
  <h1>Weather forecast for Seattle</h1>
  <section class="day-forecast">
    <h2>03 March 2018</h2>
    <p>Rain.</p>
  </section>
  <section class="day-forecast">
    <h2>04 March 2018</h2>
    <p>Periods of rain.</p>
  </section>
  <section class="day-forecast">
    <h2>05 March 2018</h2>
    <p>Heavy rain.</p>
  </section>
</article>

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@Amer-Adel Amer-Adel added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Sep 13, 2023
@github-actions github-actions bot added the Content:HTML issues related to HTML examples. label Sep 13, 2023
@wbamberg
Copy link
Contributor

each day’s forecast (<article class="day-forecast">) doesn’t make sense on its own

Why not? As I read the spec:

The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

...it seems totally plausible for a page to include "today's weather" as an "independent item of content".

@Amer-Adel
Copy link
Author

Amer-Adel commented Sep 14, 2023

If you share this article "Weather forecast for Seattle" with other website it will give a meaning

But if you share just this info (03 March 2018, Rain.) out of its context does it give a meaning!
No it should has a heading like Seattle Weather (info...) to be an article or it's just a section that group a related contend on its context.

@wbamberg wbamberg transferred this issue from mdn/content Sep 14, 2023
@github-actions
Copy link

It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

@wbamberg
Copy link
Contributor

I guess if it is appearing on a Seattle local news site the context would be pretty obvious, as it is here for example: https://komonews.com/news/local, or https://www.nbcnewyork.com/news/local/.

It's fair to say, though, that it could be improved. One of the challenges is that it wants to show that articles can be nested, but we only have a small amount of space to show markup, so we want to keep the markup as concise as possible. The spec has an example with a blog post and comments, where the comments are articles, but it would be hard to make the markup concise enough for one of these examples.

I've transferred this to the interactive-examples repo, and maybe someone will have a better suggestion there.

@caugner caugner added nit and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Oct 2, 2023
@estelle
Copy link
Member

estelle commented Oct 3, 2023

Maybe adding a comment that reads something like <!-- list of weather by hour --> to indicate to the reader that much more content would be included if this was a real example with available space.

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML issues related to HTML examples. idle Issues and pull requests with no activity for three months. nit
4 participants