Tuesday, 28 June, 2022

webmastertools4u

Webmaster Tools

single post

  • Home
  • Text grouping
HTML

Text grouping

Using line breaks and a few other tags
 


 

The text grouping commands are used to format text parts. We already know one text grouping command – paragraph <P>.

Now let’s move on to a line break. The tag for a line break is:

<BR>

When you insert this tag in your document, the contents will go to the next line. The tag does not need a closing tag afterward. Here is an example:

This is the first line<BR>And this is a second one.

This is the first line
And this is a second one.


The next command is used to format spaces. Only Netscape Navigator “understands” this command:

<SPACER>

The command has some attributes:

<SPACER TYPE=”HORIZONTAL|VERTICAL” SIZE=”size”> – TYPE indicates the space type – vertical or horizontal and size – space size in pixels.

<SPACER TYPE=”BLOCK” WIDTH=”size” HEIGHT=”size”> – the space will be as block with specified width and height. Examples:

This is a horizontal 25 pixel long space – . Here it ends.
And here is the same size vertical space – This line should be below.

The next text grouping command is used when we want that any text wouldn’t break to the next line, even after reaching the end of someone’s browser window:

<NOBR> … </NOBR>

Example:

Text text text text text, more text, more text, more text and now goes the title: <NOBR>Text grouping<NOBR>.

The next command is used inside the NOBR tags if we need to force a line break:

<WBR>

And the next command can be very useful because the text between these tags will appear exactly as in your text editor:

<PRE> … </PRE>

Example:

Here are some spaces:                  And now goes the text..... 
And here is the next line!
The next command lets you to center the text on the page:

<CENTER> … </CENTER>

Example:

This text is in the middle…

The next command is useful when we want to align the text to the left, right or center:

<DIV> … </DIV>

We use <ALIGN=”LEFT|CENTER|RIGHT”> attribute together with <DIV> tags. This attribute can be used with <P>, <H> text grouping tags too.

Example:

Command <DIV ALIGN=LEFT>This text is aligned to the left.</DIV>. And the result:

This text is aligned to the left. (<DIV ALIGN=LEFT>)

This text is in the middle. (<DIV ALIGN=CENTER>)

This text is aligned to the right. (<DIV ALIGN=RIGHT>)

The next command is used cite the text:

<BLOCKQUOTE> … <BLOCKQUOTE>

The <ADDRESS> command is used when we write address, author or similar information:

<ADDRESS> … <ADDRESS>

Example:

Text … and now goes address

Mr. X
Anywhere
NY 12345
U.S.A.

text again …

<HR>

Horizontal line tag. Different attributes can be used together with this command. Examples:


(<HR ALIGN=”LEFT” WIDTH=”50%”>)


(<HR ALIGN=”CENTER” WIDTH=”50%”>)


(<HR ALIGN=”RIGHT” WIDTH=”50%”>)

<HR SIZE=”digit”> – specifies the line thickness.

<HR WIDTH=”digit|percentage”> – specifies the line width.

<HR NOSHADE> – gives us a thick line without shadows.

<HR COLOR=name|#rrggbb> – we also can specify the line color. Examples:



The comment tag is used when we are coding our website and want to leave the notes so that we don’t forget something when we come back later:

<!–…–> or <COMMENT>…</COMMENT>

Comments are invisible to a web browser when it displays your website.

Important. If you don’t see any of the effects in the examples, it means that your web browser doesn’t “understand” the commands. Try to use a different one.

Well, let’s move on to the next tutorial HTML lists.

Recent Comments

No comments to show.

Archives

Categories