Some Basic HTML Tags: Line Break Tag
Some Basic HTML Tags: Line Break Tag
Centering Content
You can use <center> tag to put any content in the center of the page or any table cell.
Syntax- <center><p>This text is centered</p></center>
Horizontal Lines
Horizontal lines or Horizontal Rulers are used to visually break up sections of a document. The <hr> tag
creates a line from the current position in the document to the right margin and breaks the line
accordingly. It is an empty element tag.
Preserve Formatting
Sometimes you want your text to follow the exact format of how it is written in the HTML document. In
those cases, you can use the preformatted tag <pre>.
Any text between the opening <pre> tag and the closing </pre> tag will preserve the formatting of the
source document.
Syntax- <pre> This Para shows use of pre tag.
No tag is required to break line
</pre>
Hyper Linking
To create a link in HTML, we use an anchor tag <a>. The Reference is given using the reference
attribute i.e. href. The address is given double quotes.
Syntax- <a href=address, for example C:/Users/Documents/123.html>Go to 123 page</a>
HTML Images
Download Link
You can provide a download link by typing the attribute download after the address of the file in a
normal link.
Syntax- <a href=address, for example C:/Users/Documents/myimage.png download>Download My
Photo </a>
Font Tag
To change font type, we can use <font> tag. It has 3 attributes: face, color (not colour) and size. Face
defines the font type (such as Arial, Comic Sans MS etc). Color defines the font color (such as red,
green, cyan etc). Size defines the font size. Font size varies from 1 to 7.
Syntax- <p><font face=Comic Sans MS color=cyan size=4>This is text</font></p>
Alignment Tags
There are 4 types of alignments left, right, center and justify. It can be used as an attribute of <p> and
<h1> tags.
Marquee
Displays a moving text on the background. It has many attributes, like width (in %), height (in pixelsnumbers), bgcolor (specifies colour) and behavior (How the text moves, has 3 values, Alternate, Scroll
and Slide).
Syntax- <marquee width=100% height=30 behavior=alternate bgcolor=blue>My Site</marquee>