How to Reduce the Size of the White Space on a New Line in HTML
In an HTML Web page, the amount of white space between lines is typically set to a constant level. If you want to reduce this line spacing, you can do so with a form of HTML called a cascading style sheet, or CSS. This is a small code that is inserted in the HTML file's head section and gives instructions for the rest of the document.
Instructions
-
-
1
Open the HTML file that you want to modify in an editing program.
-
2
Enter the following code after the <HEAD> command:
<style type="text/css">
p.small { line-height: 100%; }
</style>
-
-
3
Adjust the line height from "100%" to whatever number you prefer. The smaller the number, the less white space there will be between lines.
-
4
Begin every paragraph in the <BODY> section that you want affected with <P CLASS="small"> and end it with </P>. For example:
<p>
This is a paragraph with unchanged white space between lines.
This is a paragraph with unchanged white space between lines.
This is a paragraph with unchanged white space between lines.
</p>
<p class="small">
This is a paragraph with a smaller white space between lines.
This is a paragraph with a smaller white space between lines.
This is a paragraph with a smaller white space between lines.
</p>
-
5
Save the file and open it in a Web browser. Tweak the line space height as needed until you achieve the reduced size that you want.
-
1
Tips & Warnings
Be careful not to set the line space height so low that your lines overlap each other. This can be hard to read.