HTML and it's Elements

HTML and it's Elements

·

3 min read

Introduction:

HTML stands for Hyper Text Markup Language. HTML is the code that is used to structure a webpage and its content. Technically, HTML is a markup language rather than a programming language. The latest version of HTML is 5.0 which is realised worldwide in the year 2014.

Syntax:

<!DOCTYPE>  

<html>  

<head>  

<title>Web page title</title>  

</head>  

<body>  

<h1>Write Your First Heading</h1>  

<p>Write Your First Paragraph.</p>  

</body>  

</html>

Types of the HTML elements:

The elements in HTML are classified into two types,

1) Container Elements

These elements have a starting and an ending tag. The content is given in between the tags.

Example:

    <b>this element is used for bold text</b>

2) Empty Elements

These elements do not contain an ending tag. They have a starting tag only. These elements are used for performing some specific functions.

Example:

    This element is used to give a horizontal rule or say line.
    <hr />

The HTML elements can also be used in a nested form.

    <b> <i> to give BOLD and ITALICS letters </i> </b>

With the nested elements, one should careful with the closing tags. That means the inner tags should be closed first then the outer tags. Like in the above example, the <i> tag closed before the <b> tag

Block-level and Inline HTML elements:

  1. Block-level elements

    Full width of the element that contains it. Block-level start on a new line, having a built-in line break before and after the element. Block-level start on a new line, having a built-in line break before and after the element.

    Examples:

    <p>,<h1> through <h6>,<ul>,<div>

  2. Inline-level elements

    Inline elements are those elements that do not begin on a new line when you insert the element in the code. They are considered as a part of the main text and not as separate sections.

    Examples:

    <a>,<b>,<i>,<img>

    Definition of those elements:

    <HTML>

This element defines the ones complete HTML document. Also, it is used as the first tag of the HTML document. It is a container element as it has both the starting and closing tag.

    <HTML> ... </HTML>

<BODY>

This element defines the body of the document. The element or the content that has to be added to the webpage is given in the HTML body. It has both the starting and the ending tag.

    <BODY> ... </BODY>

<HEAD>

The <head> element is used for the head of the document. This element contains the title of the document, linking to scripts, adding style by style tag, etc.

<HEAD>
        <TITLE> MY TITLE </TITLE>
        <STYLE> . . . </STYLE>
    </HEAD>

<Span>

The <span> element functions much like the <div> element, but for inline elements, rather than block-level. For example, imagine that you wanted to group some of the words in one of your <p> elements, but not all of them.

<p>Here's a paragraph, but <span>these words</span> are grouped.</p>

<a>

The HTML anchor tag is a hyperlink that links one page to another page. It can create hyperlinks to another webpage as well as files,any URL, or location. The"href" attribute is the most important attribute of the HTML tag, and it links to the destination of the page.

<a href = "..........."> Link Text </a>

<div>

HTML <div> tag to group the large section of HTML elements together. The div tag is generally used to group HTML elements and apply CSS style to those elements at once.

<div style="border:1px solid #E21717;padding:2px;font-size:25px">  
<p>Welcome to ineuron, lets start coding togather and make it better.</p>  
<p>This is second paragraph</p>  
</div>