TechBook will reward the Top Ten Users for the month of October with a One Year FREE Web Hosting Account

Best way to add Horizontal and vertical Spaces in HTML

Post Reply
Techpedia
Newbie on TechBook
Posts: 28
Joined: Sat Aug 05, 2017 4:30 pm

Best way to add Horizontal and vertical Spaces in HTML

Post by Techpedia » Sat Sep 23, 2017 1:25 pm

1. One method is to create an empty, completely transparent image with a height of 1 pixel and a width of about 40 to 70 pixels (depending on how wide you want your indentation), anchor the image at the beginning of each paragraph, and the text will wrap around the image creating an indentation. It's too much work for me.

2. You can also create an indentation using the <SPACER> tag, but keep in mind, this tag is recognized by Netscape 3.0 and 4.0, but not by any version of Internet Explorer to date.

Use the HORIZONTAL SIZE attribute of the <SPACER> tag to create a paragraph indentation. For instance, to get a 50 pixel horizontal indentation before a line of text, your HTML should look like this:

<SPACER TYPE=HORIZONTAL SIZE=50>Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here.

And you will get this (no indentation if you are using Explorer):

Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here.

3. The quickest way to create paragraph indentation - and the method recognized by all browsers - is to use a series of non-breaking spaces. HTML ignores extra white space within text. A browser will recognize the first space after a character, but any white space after is ignored. However, you can use a non-breaking space (&nbsp;), or a series of non-breaking spaces, to put extra white space within, or at the beginning or end of a text string.

For example, adding 6 non-breaking spaces at the beginning of the text string will indent the following sentence by 6 character spaces:

This text has an indent of 6 non-breaking spaces.

SPACING ABOVE AND BELOW TEXT:

There are two ways to create space above or below text:

1. You can use the VERTICAL SIZE attribute of the <SPACER> tag to create space above text. For instance, to get a 30 pixels of space above text, your HTML should look like this:

<SPACER TYPE=VERTICAL SIZE=30>Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here.

And you will get this - 30 pixels of space before the following text:

Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here. Your text here.

Once again, the <SPACER> tag is recognized by Netscape 3.0 (and later versions), but not by any version of Internet Explorer to date.

2. The cheater's way to include space above or below text (and the one method recognized by all browsers) is to just add some blank lines. Adding a series of paragraph breaks will not work (i.e. <P> <P> <P> <P> <P> <P>), but add a non-breaking space in between each paragraph break, and you have a very simple way of adding space above or below text:

<P> &nbsp; <P> &nbsp; <P>

SPACING AROUND IMAGES:

Using HSPACE (horizontal space) and VSPACE (vertical space) within the IMG SRC tag will give you horizontal and vertical padding around an image. For example, the following with give you 10 pixels above, below, and on each side of your image:

<IMG SCR="yourimage.gif" HSPACE=10 VSPACE=10>

Ref: best2know

LindaUtend
Newbie on TechBook
Posts: 5
Joined: Thu Jan 11, 2018 2:57 pm
Membership Category: Vendee/Hire Freelancer

Aliexpress Great discounts

Post by LindaUtend » Thu Jan 11, 2018 3:00 pm

Aliexpress is Great sale now...



















.

LindaUtend
Newbie on TechBook
Posts: 5
Joined: Thu Jan 11, 2018 2:57 pm
Membership Category: Vendee/Hire Freelancer

Aliexpress Great discounts

Post by LindaUtend » Thu Jan 11, 2018 3:01 pm

Aliexpress is Great sale now...



















.

LindaUtend
Newbie on TechBook
Posts: 5
Joined: Thu Jan 11, 2018 2:57 pm
Membership Category: Vendee/Hire Freelancer

Aliexpress Great discounts

Post by LindaUtend » Thu Jan 11, 2018 3:02 pm

Aliexpress is Great sale now...



















.

Post Reply
kuchnie kraków opinie

Who is online

Users browsing this forum: No registered users and 1 guest