0% found this document useful (0 votes)
18 views

HTML Syntax 1

The document discusses various HTML tags and their syntax and usage with examples, including attributes, entities, basic tags like <html>, <head>, <body>, <meta>, <p>, <br>, comments, <hr>, <marquee>, heading tags, text formatting tags, align attribute, and font tag.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

HTML Syntax 1

The document discusses various HTML tags and their syntax and usage with examples, including attributes, entities, basic tags like <html>, <head>, <body>, <meta>, <p>, <br>, comments, <hr>, <marquee>, heading tags, text formatting tags, align attribute, and font tag.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

HTML IMPORTANT TAGS SYNTAX WITH EXAMPLE

Attributes Example:
<!DOCTYPE html>
<html>
<body bgcolor=” red”>
</body>
</html>
Entities Example
<!DOCTYPE html>
<html>
<body>
<h1>HTML Entity Example</h1>
<h2>The copyright sign: &copy;</h2>
<h2>The less-than sign: &lt;</h2>
<h2>The greater-than sign: &gt;</h2>
</body>
</html>
Basic HTML Tags
<!DOCTYPE html>
<html>
<head>
<title>Air Force School Avadi</title>
</head>
<body>
Hello, Welcome to Air Force School Avadi.
</body>
</html>
Meta Tag
Syntax:
<META NAME=" " CONTENT=" ">
Example:
<DOCTYPE html>
<HTML>
<HEAD>
<TITLE> BASICS ABOUT COMPUTER</TITLE>
<META NAME="AUTHOR" CONTENT="Ashwini">
<META NAME="Keyword" CONTENT="Computer, Input, Processes, Instruction">
<META NAME="Description" CONTENT="This web page gives basic information about
computers">
</HEAD>
<BODY>
Being a modern-day kid, you must have used, seen, or read about computers. This is because they are
an integral part of our everyday existence.
</BODY>
</HTML>
Paragraph Tag
Syntax

<P>…………………………………. </P>
Example
<DOCTYPE html>
<HTML>
<HEAD>
<TITLE> BASICS ABOUT COMPUTER</TITLE>
</HEAD>
<BODY>
<P>Being a modern-day kid you must have used, seen, or read about computers. This is because they
are an integral part of our everyday existence. Be it school, banks, shops, railway stations, hospital or
your own home, computers are present everywhere, making our work easier and faster for us. As they
are such integral parts of our lives, we must know what they are and how they function. </P>
<P>Let us start with defining the term computer formally. The literal meaning of computer is a device
that can calculate. However, modern computers can do a lot more than calculate. Computer is an
electronic device that receives input, stores or processes the input as per user instructions and provides
output in desired format.</P>
</BODY>
</HTML>
Break Tag
Syntax
<BR>
Example:
<DOCTYPE html>
<HTML>
<HEAD>
<TITLE> BREAK TAG</TITLE>
</HEAD>
<BODY>
<BR>BBBBBBBBBBBBBB<BR>CCCCCCCCCCCCC<BR>RRRRRRRRRRRRR
</BODY>
</HTML>
Blank Space & Comments:
Black Space: &nbsp;
Comments: <!-- -->
Example:
<!DOCTYPE html>
<html>
<head>
<title>Non-Breaking Space & Comments</title>
</head>
<body bgcolor=pink>
<p>What will you learn
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;today?</p>
<!-- nbsp is an entity it can be added in a web page using the code &nbsp; -->
</body>
</html>
HR Tag:
Syntax: <HR>
Example:
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE> HR TAG</TITLE>
</HEAD>
<BODY>
<center><P>Hello, Welcome</p></center>
<HR SIZE="20" width="800" color="blue">
</BODY>
</HTML>
Marquee Tag
Syntax:
<marquee> </marquee>
Example:
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee Tag</title>
<h3> <center>marquee Tag </center> </h3>
</head>
<body>
<marquee>hello</marquee>
<marquee bgcolor="pink" height=100" width="300" direction="up" loop="5" Scrollamount=70>
Hello welcome to airforce school </marquee>
</body>
</html>
Heading Tag Example with Syntax:
<!DOCTYPE html>
<html>
<body>
<center>
<h1>Asia</h1></center>
<h2>India</h2>
<h3>Tamil Nadu</h3>
<h4>Chennai</h4>
<h5>Avadi</h5>
<h6>Muthapudupet</h6>
</body>
</html>

Various Text Formatting Tags:


Syntax:
Bold: <B> </B>
Italic: <I> </I>
Underline: <U> </U>
Strike Through: <strike> </strike>
Superscript: <sup> </sup>
Subscript:<sub> </sub>
Example:
<!DOCTYPE html>
<html>
<head>
<title>Text Formatting Example</title>
</head>
<body>
<br><b>The following sentence is in bold typeface .</b>
<br>
<br><I>The following sentence is in Italic typeface.</I>
<BR>
<U>The following sentence is underlined. </U>
<br>
<br><Strike>The following sentence is striked .</Strike>
<br>
<br>Example of Subscript: H<sub>2</sub>O.
<br>
<br>Example of Superscript: 2x<sup>2</sup>.
<br>
<br><TT>This Example of Typewriter Text. <TT>
</body>
</html>

Align Attribute:
<!DOCTYPE html>
<html>
<head>
<title>HTML Alignment Tag</title>
</head>
<body>
<H3 align=right>Welcome to AirForce School</H3>
<H3 align=left>Welcome to AirForce School</H3>
<H3 align=center>Welcome to AirForce School</H3>
</body> </html>
Font Tag Example:
<!DOCTYPE html>
<html>
<head>
<title>HTML Alignment Tag</title>
</head>
<body>
<br>
<p><Font face="Broadway,Times new roman" size="4" color="red">Computer
Science.</font></p>
<br>
</body>
</html>

You might also like