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

Input elements can't have ::before or ::after content due to being Replaced Elements #19714

Open
contentfree opened this issue Aug 18, 2022 · 0 comments
Labels
Content:Learn:Forms Learning area Forms docs help wanted If you know something about this topic, we would love your help!

Comments

@contentfree
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Learn/Forms/UI_pseudo-classes#using_generated_content_with_pseudo-classes

What specific section or headline is this issue about?

Using generated content with pseudo-classes

What information was incorrect, unhelpful, or incomplete?

The example given is wrong or at least misleading. An element is considered a Replaced Element and does not allow ::before or ::after pseudo elements (even though, strangely, the example given in the page of adding to a radio button does work).

The page then goes on to correctly say "Since form inputs don't directly support having generated content put on them (this is because generated content is placed relative to an element's formatting box, but form inputs work more like replaced elements and therefore don't have one)" – This seems incongruent with the prior example (which clearly uses a form input… and works)!

What did you expect to see?

It might be useful to note that "While our radio button example does allow styling, this is a bit of a strange case and does not apply to most form inputs"

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

No response

Do you have anything more you want to share?

No response

@github-actions github-actions bot added Content:Learn:Forms Learning area Forms docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Aug 18, 2022
@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn:Forms Learning area Forms docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

No branches or pull requests

2 participants