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

<meter> examples have confusing meter bars inline #34413

Open
PrimeLemur opened this issue Jun 26, 2024 · 3 comments · May be fixed by #34429
Open

<meter> examples have confusing meter bars inline #34413

PrimeLemur opened this issue Jun 26, 2024 · 3 comments · May be fixed by #34429
Labels
Content:HTML Hypertext Markup Language docs

Comments

@PrimeLemur
Copy link

PrimeLemur commented Jun 26, 2024

MDN URL

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

What specific section or headline is this issue about?

Examples: Simple Example: HTML: first example shown

What information was incorrect, unhelpful, or incomplete?

I see:
image
This is the HTML from the example:

<p>
  Heat the oven to <meter min="200" max="500" value="350">350 degrees</meter>.
</p>

What did you expect to see?

I suspect the page author intended the example to render as:
image
I produced this output by moving the closing tag:

<p>
  Heat the oven to <meter min="200" max="500" value="350"></meter> 350 degrees.
</p>

This tag closure is more consistent with the 2nd example in the same section on the same page.
I'm not entirely certain what the example's author intended to happen in the example, but I think its reasonable to assume the text "350 degrees." was meant to be displayed after the meter.

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

No response

Do you have anything more you want to share?

I am using MS Edge (Version 125.0.2535.85 (Official build) (64-bit)) to view the MDN examples. I don't currently have access to other browsers for comparison. Sorry I couldn't be more helpful. This is my first Git issue submission.

MDN metadata

Page report details
@PrimeLemur PrimeLemur added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jun 26, 2024
@github-actions github-actions bot added the Content:HTML Hypertext Markup Language docs label Jun 26, 2024
@PrimeLemur
Copy link
Author

PrimeLemur commented Jun 26, 2024

I didn't escape the html for the example & my solution.

This is the html from the example on MDN.

<p>
  Heat the oven to <meter min="200" max="500" value="350">350 degrees</meter>.
</p>

This is what I think it should look like:

<p>
  Heat the oven to <meter min="200" max="500" value="350"></meter> 350 degrees.
</p>

My bad. Hope this makes it clearer.

@Josh-Cena
Copy link
Member

Hello! This is a bit confusing but intentional. The idea is that the text and the meter bar show the exact same content, so only one of them is displayed. The text is meant as a fallback text for (a) screen readers (b) browsers that don't support meter bars (c) any other cases when the bar doesn't show.

Is this a bad example? I'd say yes because you would never do this. I think both examples on this page should be replaced with something more realistic.

@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jun 26, 2024
@Josh-Cena Josh-Cena changed the title Issue with example in "<meter>: The HTML Meter Element" Closing tag in first example in wrong place? <meter> examples have confusing meter bars inline Jun 26, 2024
@PrimeLemur
Copy link
Author

Thank you for the response & clarifying what was intended. From the perspective of someone unfamiliar with the <meter> tag, it is confusing, and as you say, the stated example scenario is part of the problem. Even a one-line explanation of what the example demonstrates would've helped. Having an instruction to heat an oven to a temperature, when there is only a meter without any numeric guidance, is so counter-intuitive, I couldn't reconcile the idea that it might have been intentional. Thanks for adjusting the issue title, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants