Docs - h3 heading misaligned inside div
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
The h3
heading for “TypeScript interfaces aren’t valid tokens” is misaligned within its div
.
Expected behavior
The h3
heading should be visually left aligned within it’s div
to maintain consistency with other sections.
Minimal reproduction of the problem with instructions
Open Angular’s documentation for “TypeScript interfaces aren’t valid tokens”
What is the motivation / use case for changing the behavior?
To maintain consistency with other sections in the Angular documentation.
Environment
Angular version: 1.6.9
Browser:
- Chrome (desktop) version 64.0.3282.167 (Official Build) (64-bit)
- Chrome (Android) version XX
- Chrome (iOS) version XX
- Firefox 58.0.2 (64-bit)
- Safari (desktop) Version 11.0.3 (13604.5.6)
- Safari (iOS) version XX
- IE version XX
- Edge version XX
GIF of Bug
Upon closer inspection inside Chrome’s dev tools, it looks like the heading isn’t being properly aligned for a CSS reason:

Potential Fix
A potential fix might be adding padding-left: 34px;
to .l-sub-section h3
found in _subsection.scss:13
. This would result in the following:

Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
heading tag won't work in alignment attribute - Stack Overflow
It works like this. heading tags are supposed to mark that as heading and some specific styling by default. center property always works...
Read more ><h1>–<h6>: The HTML Section Heading elements
The to HTML elements represent six levels of section headings. is the highest section level and is the lowest.
Read more >Alignment, font styles, and horizontal rules in HTML documents
15 Alignment, font styles, and horizontal rules · This example centers a heading on the canvas. · Similarly, to right align a paragraph...
Read more >How to Align the Content of a Div Element to the Bottom
In this example, we use a "hex" value for the color. Use the text-align property to align the inner content of the block...
Read more >H1, H2, H3, H4, H5, H6 - headings [Learning HTML 3.2 by ...
The default is left alignment, but this can be overridden by an enclosing DIV or CENTER element. (HTML 2.0, which has no ALIGN...
Read more >
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually, looking again at this, I don’t think it is the fault of the
h3
element, instead it is related to the anchor that appears when you hover. This is doing some sneaky position, which affects where the h3 text begins. This is done in heading-anchors.scss:34.After looking into this issue, and applying @SeanPrashad 's fix, I noticed that the header is not being aligned properly in mobile/responsive views. See below:
Should I proceed with his solution?