question

FDJ358-1100 avatar image
0 Votes"
FDJ358-1100 asked FDJ358-1100 commented

Modern SharePoint heading levels appear to be wrong when inspecting the source code

When I add the default Text web part on a page and add a heading (e.g. Heading 2) and then use the inspect element to look at the code it is reported as the wrong heading level e.g. Heading 2 is reported as a Heading 3 (see screenshot below). What is going on?

9454c2f3-bd21-4f6a-8989-f767d06e9192


office-sharepoint-onlinesharepoint-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered FDJ358-1100 commented

Hi @FDJ358-1100 ,

Per my test, the h1 tag has been formatted with specific css style in the page. You could try to change h2 to h1 in the code. As the below picture shows:

95048-image.png

If the font style Heading1 use the h1 tag, it will be overrided with the default css style. So I think that's why the font style Heading starts with h2 .


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.







image.png (45.7 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @FDJ358-1100 ,

Is there anything update? If my reply helps you, you could accept as answer.



0 Votes 0 ·

Let me check that I understand you correctly. You are suggesting that when I want to add a H2 I should add a H1 instead. And when I want to add a H3 I should add a H2..etc. Is that what you are suggesting?

0 Votes 0 ·

Yes, you are right :)

0 Votes 0 ·
Show more comments