HTML
Attributes

Attributes are additional values that adjust their behavior of elements in various ways to meet the criteria the users require.

Some elements do not require attributes like heading tags <h1>, paragraph rag <p> and some others. But most of the HTML tags may have attributes as their characteristics.

Attribute Breakdown

An attribute is combination of two things:

  • Name: Name is the property you want to set. For example, the image <img> element carries an attribute whose name is src and alt.
  • Value: The value is an what you want the value of the property to be set. It always put within quotations.

Attribute names and attribute values are case-insensitive and should be in lowercase.

Basic Attributes

The basic elements of an HTML code are:

Heading: denoted using the <h1>, <h2>, <h3>, <h4>, <h5>, <h6> tags.

Paragraph: denoted using the <p> tag.

Horizontal ruler: denoted using the <hr> tag.

Link: denoted using the <a> (anchor) tag.

List: denoted using the <ul> (unordered list), <ol> (ordered list) and <li> (list element) tags.

Image: denoted using the <img> tag

Divider: denoted using the <div> tag

Span: denoted using the <span> tag

Attribute Example

Below example will demonstrate the basic architecture of HTML Attributes

                    

<!doctype html>  
<html>
 
   <head> 
      <title>HTML Attribute Example</title> 
   </head>
  
   <body> 
      <h3 align = "left">This is left aligned</p> 
      <h4 align = "center">This is center aligned</p> 
      <h5 align = "right">This is right aligned</p> 
   </body>
   
</html>

Introduction to HTML

HTML stands for Hyper Text Markup Language. It is used to design web pages using markup language.

HTML is the combination of Hypertext and Markup language.

  • Hypertext defines the link between the web pages.
  • Markup language is used to define the text document within tag which defines the structure of web pages.

It is noteworthy that HTML is not a programming language, but rather a markup language. Let us find a dividing line between these types of language:

  • A markup language is used to control the presentation of data, like “represent these user names as a bullet list or as a table”.
  • A programming language is used to transform data. It does so by creating CPU instructions that rewrite the input data into the output; hopefully, the desired output.

Most of markup languages are human readable. Language uses tags to define what manipulation has to be done on the text. HTML is a markup language which is used by the browser to manipulate text, images and other content to display it in required format.

Short History

HTML was created by Tim Berners-Lee in 1991. The first ever version of HTML was HTML 1.0 but the first standard version was HTML 2.0 which was published in 1999.

HTML VersionYear
HTML 1.01991
HTML 2.01995
HTML 3.21997
HTML 4.011999
XHTML2000
HTML52014

HTML Breakdown

The HTML document can be divided into two sections:

Head Section: The <head> element is a container for all the head elements. <title> (this element is required in an HTML document), <style>, <base>, <link>, <meta>, <script> and <noscript> tag can go inside the <head>

Body Section: The body of HTML document contains the text that is displayed on a web page. The body section is enclosed within <body> tag. It gives a description of the document layout and structure.

HTML Example

below example will demonstrate the basic architecture of HTML Document

                    

<!doctype html>
<html>
            <head> 
                        <title>My First HTML Page</title> 
             </head>
             <body> 
                         <p>HTML stands for Hypertext Markup Language</p>
             </body>
</html>