Office365 SP2013 SP2016
Sometimes when adding content to a SharePoint page, such as a web part or custom code, you may find some items are not properly aligned or have more space between them then you expected. (see image below)
The reason for this is that SharePoint will sometimes add extra characters to the page's markdown which cannot be seen in the Source Editor. Instead, you need to open your browser's developer console (by pressing f12), navigate to the misaligned element, and find characters like ​
in the image below
To remove remove a single hidden character from a specific part in the page:
- Open the page in edit mode
- Open your browser's developer console by pressing F12 on your keyboard
- Find the misaligned item and the hidden character.
- Select the character and delete it.
- Confirm that the space has been removed and you didn't erase the wrong thing. You can use CTRL+Z to undo your actions.
- Once the character is removed you can close de developer console and save the page.
- The space should now be removed.
If you want to remove all the hidden characters from a page:
- Open the page in edit mode
- Open your browser's developer console by pressing F12 on your keyboard
- Press the console tab
- Paste the following snippet into the console and press Enter to execute the code
var contentZone = $('#DeltaPlaceHolderMain'); contentZone.html(contentZone.html().replace(/\u200B/g,'').replace(/\u8203/g,''));
- Now that the characters are removed, you can close the developer console and save the page.
- The spaces should now be removed.
Comments