Allow Div Elements In H1, H2, H3, H4, H5, H6 Elements #6503 - GitHub
- Notifications You must be signed in to change notification settings
- Fork 3.1k
- Star 9.2k
- Code
- Issues 2.3k
- Pull requests 237
- Actions
- Wiki
- Security 0
- Insights
Description
Hello!
I've been having a discussion with colleagues about using div elements in h-elements (h1, h2, h3...), when it makes sense to style parts of the header differently, even though the content belongs together (and should not, for good reasons, become two seperate h-elements). Here is an example.
<h2> <div>Beans are disgusting</div> <div>This is why we forbid beans</div> </h2>I have just learned that a span within a h-element is allowed:
<h2> <span>Beans are disgusting</span> <span>This is why we forbid beans</span> </h2>But, to force a line break between the two, I would either have to add a <br /> or display: block to the span elements, and that feels counter-intuitive when there is a working solution already that makes those things unnecessary.
I would love to hear the reasons why example A is not allowed, and why example B is! :-) And/or, if this can be discussed to make a change in the spec.
Addendum: I got linked info about the hgroup element, which is great, but I understand it is not yet supported by assistive technology, which is why I wanted to do this in the first place. (sadface)
With the highest regards, Anneke
Metadata
Metadata
Assignees
No one assignedLabels
No labelsNo labelsType
No typeProjects
No projectsMilestone
No milestoneRelationships
None yetDevelopment
No branches or pull requestsIssue actions
You can’t perform that action at this time.Từ khóa » H1 H2 H3 Div
-
–
: The HTML Section Heading Elements - MDN - Mozilla
-
HTML H1 To H6 Tag - W3Schools
-
Headings
-
Header Tags: A Simple (But Complete) Guide To H1, H2 And H3 Tags
-
Heading Tags (H1, H2, H3, P) In HTML - Accessibility At Penn State
-
H1, H2, H3.. Elements Eats Div Margins - Stack Overflow
-
HTML Elements List - CMRR
-
How To Prevent A Line Break With An H1, H2, H3 Tag - Ironpaper
-
H1 H2 H3 Code Example - Code Grepper
-
Html,body,div,span,applet,object,iframe,h1,h2, H3,h4,h5,h6,p ...
-
Question On
Lecture - Community - Codecademy ForumsH1 H2 H3 Help Needed - Weebly Community
HTML:
Tag - TechOnTheNet
H1, H2, H3, H4, H5, H6, P, A, Span - Identity Cloud
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu