HTML Basic Elements

HTML Basic Elements 

HTML Basic Elements :

It includes HTML documents , paragraphs , headings , links, images , lists etc...


HTML Documents 


<!DOCTYPE html> : All HTML documents must start with a document type declaration

HTML document begins with <html> and ends with </html> tag.

Main part / visible part of the HTML document is between <body> and </body> tag.

Program :


<!DOCTYPE html>
<html>
<head>
<title> NibKarma HTML </title>
</head>
<body>
</body>
</html>


HTML Headings

Headings in html are possible <h1> , <h2> , <h3> , <h4> , <h5> and <h6>.

Program :


<!DOCTYPE html>
<html>
<head>
<title> NibKarma HTML </title>
</head>
<body>
<h1> NibKarma </h1>
<h2> NibKarma </h2>
<h3> NibKarma </h3>
<h4> NibKarma </h4>
<h5> NibKarma </h5>
<h6> NibKarma </h6>
</body>
</html>

Output :


As you shown in above output the difference between tags we can see clearly.

HTML Paragraphs

<p> tag is used in html to write paragraph and ends with </p>.

Program :


<!DOCTYPE html>
<html>
<head>
<title> NibKarma HTML </title>
</head>
<body>
<h1> NibKarma </h1>
<p> Nibkarma HTML And CSS </p>
</body>
</html>

Output :



As we can see in above result Paragraph will shown as above.

HTML Links

Links in the HTML are defined with the <a> tag:

Program :

<a href="https://www.nibkarmahtmlcss.com">This is a link</a>

href attribute specifies destination of the link. 

It means it shows source for the data.

The Attributes are used to provide additional information about HTML elements.


HTML Images

Images are defined with the <img> tag.

A source file (src), alternative text (alt), width, and height are provided as attributes.

Program :

<img src="nibkarma.jpg" alt="nibkarmahtmlcss.com" width="100" height="122">

HTML Lists

There are three types of lists.

<ul> − An unordered list. 

It will list items using plain bullets.

<ol> − An ordered list. 

It will use different schemes of numbers to list your items.

<dl> − A definition list. 

It arranges your items in the same way as they are arranged in a dictionary.

Program :

<!DOCTYPE html>
<html>

   <head>
      <title>Nibkarma</title>
   </head>
   <body>
      <ul>
         <li>A</li>
         <li>B</li>
         <li>C</li>
         <li>D</li>
      </ul>
  
  <ol>
         <li>A</li>
         <li>B</li>
         <li>C</li>
         <li>D</li>
      </ol>
  
   </body>
   
</html>

Output :


As you can see in above program here are both ordered and unordered list are created.














Comments

Popular posts from this blog

What Is Inheritance In C++? Types Of Inheritance?

CONCEPT OF DBMS!!

Basic Concepts Of OOPC!!