How to Remove Unwanted Borders from HTML Documents in Word
Question details
The user needs to remove an unexpected line or border that appears around the page when opening an HTML document in Word.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Opening, viewing, or editing an HTML file within a word processor.
- Observed behavior
- An unwanted border displays around the page, which may either be an applied, printable page border or just a non-printable visual text boundary.
Before making any formatting changes, navigate to File > Print to check the Print Preview. This will help you determine if the line is an actual printable element or just a visual layout boundary used by the editor.
Remove Printable Page Borders via the Borders and Shading Menu
Use this method if the unwanted line appears in the Print Preview, confirming it is an applied page border.
When Word opens an HTML file, it may interpret some CSS styling as page borders. If you can see the line in the Print Preview window, you can easily remove it using the Borders and Shading settings.
Click on 'File' in the top left corner, then select 'Print'. Look at the preview on the right to see if the border is visible. If it is, return to your document.
Navigate to the 'Home' tab on the ribbon. In the Paragraph group, click the drop-down arrow next to the Borders icon and select 'Borders and Shading' at the bottom of the list.
In the Borders and Shading dialog box, click on the 'Page Border' tab at the top. Under the Settings section on the left, select 'None'.
Click 'OK' to apply the changes. The unwanted border will disappear from your document. You can now save your file.

Hide Visual Text Boundaries
Apply this solution if the line does not appear in the Print Preview, meaning it is just a visual guide in your workspace.
Manage Borders and Layouts Effortlessly with WPS Office
WPS Writer offers a highly compatible and intuitive interface for opening and editing HTML documents. You can easily manage page borders, layout elements, and text boundaries without the confusion of unexpected formatting issues.
- 1. Open the HTML File in WPS Writer: Launch WPS Office, click on 'Writer', then go to 'Menu' > 'Open' to select and load your HTML document.
- 2. Access Page Borders: Navigate to the 'Page Layout' tab on the top ribbon and click on 'Page Borders' to open the formatting dialog.
- 3. Remove the Border: In the Page Border tab, choose 'None' from the settings on the left side and click 'OK' to clear the formatting.
- 4. Save the Document: Go to 'Menu' > 'Save As' to safely save your cleaned-up document as an HTML file, or export it to DOCX or PDF.

Frequently Asked Questions
Why does a border appear when I open an HTML file in Word?
HTML files often contain CSS styles, nested tables, or div borders that Word interprets as document-level formatting. Word attempts to maintain the visual structure of the web page, which sometimes results in unexpected page borders or text boundaries.
How can I tell if a border in my document will actually print?
The easiest and most reliable way to check is by using the Print Preview feature. Navigate to File > Print. If you see the border in the preview pane, it will print on paper. If it is invisible in the preview, it is just a visual guide within the software.
What are text boundaries in Word and how do they differ from borders?
Text boundaries are non-printing dotted lines that show the margins of your document, paragraphs, and objects to help you align content visually. Page borders are printable formatting elements applied to the edges of your page. Text boundaries can be turned off in File > Options > Advanced.
Will removing the border in Word alter the original HTML code?
Yes, if you remove a page border and save the file back into the HTML format, the word processor will update the underlying HTML and CSS code to reflect the removal of that border.




