Monday, 17 September 2018

Basic Commands or Tags in HTML | HTML Basics - Online Help

Let's discuss the basic commands or tags in HTML

 HTML contains some basic tags which are used for formatting the documents and it contains some tags with their attributes which is used to add graphics effect for the documents.

Basic commands or tags in HTML:

1. Bold :<b>.................</b>

This tag is used to display the given text in bold letters.

Example

<b>Welcome to the online Help</b>

The output of this tag is:

Welcome to the online Help

2.Italic :<i>.................</i>

This tag is used to display the given text as italics.

Example

<i>Welcome to the online help</i>

The output of this tag is:

Welcome to the online help

3. Underline :<u>..................</u>

This tag is used to underline the given text.

Example

<u>Welcome to the online help</u>

The output of this tag is:

Welcome to the online help

Sample coding for basis tags is:

<html>
<head>
<title>welcome to the blog</title>
</head>
<body>
<b>Welcome to the online help</b>
<i>Welcome to the online help</i>
<u>Welcome to the online help</u>
</body>
</html>

4. BODY tag <body>

The Body tag contains all the text and graphics of the document with all the HTML tags that are used for controlling and formatting of the page. The general form is
<BODY>
Your document goes here
</BODY>
Body tags contain their attributes that can be used for graphics of the document.

Also Read: advantages and disadvantages in HTML


Attributes used with <BODY>:

I. BGCOLOR: It is used to set the background color for the document.

<BODY BGCOLOR=” yellow”>
Your document text goes here
</BODY>

II. TEXT: It is used to set the color of the text of the document.

<BODY TEXT=” red”>
Your document text goes here
</BODY>


III. MARGINS: It is used to set the Margin of the document. We can set Left
hand/ Right-hand margin for the document.

-Left Margin: used to set the left-hand margin of the document,

<BODY LEFTMARGIN=”60”>
This document is indented 60 pixels from the left-hand side of the page.
</BODY>


-Top Margin: used to set the left-hand margin of the document.

<BODY TOPMARGIN=”60”>
This document is indented 60 pixels from the top of the page.
</BODY>

IV. BACKGROUND: It is used to point to an image file that will be used as the background of the document. The image file will be tiled across the document.

<BODY BACKGROUND=”filename.gif”>
Your document text goes here
</BODY>


Center:<center>---</center>

This tag is used to center the given text.

Example:

<center> welcome to the blog</center>
Output:
Welcome to blog

5. Line Break:<br>

<br> tag is a break tag. This tag is used to break up the current line and cursor goes to the next line.

Example
<html>
<head>
<title>Break Example </title>
</head>
<body>
computer is an <br> electronic <br>device
</body>
</html>

The output of this coding is
Computer is an
electronic
device

6. Paragraph:<p>---</p>

It begins with <p> and ends with </p>.Multiple paragraphs may appear in a single document. This tag is used to begin a new paragraph.The general format is

<p align="value ">

If value=left,it aligns the left paragraph.

If value=right, it aligns the right paragraph.

If value =center,it aligns the center paragraph.

If value= justify, it aligns the justify paragraph.

Example

<p align:"left">
This tag aligns the paragraph to left.


7.Heading styles:

The line just above was a header,i.e.a title for a new section of a document. There are six headers:<h1>,<h2>,<h3>,<h4>,<h5>,<h6>.H1 is the"Main" header, usually used once at the top of the document.H6 is the"smallest" header and is rarely used, though it's often abused to make small bold text.

Example
<html>
<head>
<title>heading</title>
</head>
<body>
<h1>the appearence of the heading h1 tag </h1>
<h2>the appearence of the heading h2 tag </h2>
<h3>the appearence of the heading h3 tag </h3>
<h4>the appearence of the heading h4 tag </h4>
<h5>the appearence of the heading h5 tag </h5>
<h6>the appearence of the heading h6 tag </h6>
</ body>
</html>

The output of this coding is
the appearance of the heading h1 tag
the appearance of the heading h2 tag
the appearance of the heading h3 tag
the appearance of the heading h4 tag
the appearance of the heading h5 tag
the appearance of the heading h6 tag 


8.Horizontal:<hr>tag

The parts of the document can be separated from each other, making the document easier to the reader, by placing horizontal lines between them. such lines are called horizontal rules.

Example

<html>
<head>
<title>
Horizontal rule</title>
</head>
<body>
html<hr>
it's a markup tag <hr>
it is used to create web page<hr>
</body>
</html>

9. Font:<font>...........</font>

This tag is used to specify the size of the font and the color of the text to be displayed. the general format is
<font attribute="value>
--------------------
-------------------
</font>

Also ReadHTML Frames

font attribute:

face - This attribute is used to set the type of font.
Color - This attribute is used to set the specific color to the font.
Size - This attribute is used to set the size of the font.
Example:

<html>
<head>
<title>Font eaxmple</title>
</head>
<body>
<font face="Times New Roman" color="blue" size="64"> Html is not a programming language</font>
</body>
</html>

No comments:

Post a Comment