Onevinn blog

Highlight custom text on any Microsoft Docs page

Written by Tom Aafloen | 09 Oct 2020

Sometimes I want to highlight specific text when I’m sharing a Microsoft Docs-page to someone, like in this example:

You can do this yourself by appending the following text after the Docs-link:

?view=o365-worldwide#:~:text=Text To highlight

Unfortunately, this only works in Edge and Chrome, not in Firefox or IE.

Here’s an example:

Original Docs-link:
https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-whatis

Appended text:
https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-whatis?view=o365-worldwide#:~:text=cloud-based identity

Result:

The yellow highlighting goes away when you click anywhere on the page or reload it.

If you want to highlight more text, you can add start text and end text. Everything in-between will be highlighted:

?view=o365-worldwide#:~:text=Start of highlight,End of Highlight

Example:
https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-whatis?view=o365-worldwide#:~:text=Azure Active Directory (,Microsoft 365.

Result:

I needed to add the ”(” there since the text Azure Active Directory existed many times on the page. Without it, it looked like this:

In other words, you will have to test your link to make sure it looks as expected.

Note that any spaces need to be converted to %20 for the entire link to be clickable:

https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-whatis?view=o365-worldwide#:~:text=Azure Active Directory (,Microsoft 365.  <- Missed

https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-whatis?view=o365-worldwide#:~:text=Azure%20Active%20Directory%20(,Microsoft%20365.

You don’t have to add them all manually. If you copy/paste the entire link into a web browser, it will convert %20 (and any other special characters according to standard HTML URL Encoding) wherever needed.

I hope this was a helpful tip!