question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs - h3 heading misaligned inside div

See original GitHub issue

I’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

angularheadingbug

Upon closer inspection inside Chrome’s dev tools, it looks like the heading isn’t being properly aligned for a CSS reason:

screen shot 2018-02-23 at 12 34 03 pm

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:

screen shot 2018-02-23 at 12 37 53 pm

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
petebacondarwincommented, Feb 24, 2018

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.

1reaction
haoRchencommented, Feb 24, 2018

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:

mobile view error

Should I proceed with his solution?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found