Featured post

Why should I learn Go?

Image
What is unique about GO language? Here are some of the advantages of GO programming language:           Code runs fast           Garbage collection           Simpler objects           Efficient concurrency Code runs faster: Before understanding why GO runs faster, let us know the process of software translation. Basically, we have three broad categories of languages:             Machine level language ·        Machine level language is a low-level language where instructions are directly executed on the CPU. Machine level instructions are small steps which are straight forward and simple (Ex: ADD, SUBTRACT, MULTIPLY ) Assembly language ·        Assembly language is similar to machine level language but a bit more specific for humans to understand. For example, 1000...

What is HTML ?


So what is HTML? What does it even mean and how is it related to web? In this post we are going to talk about three big technologies that drive the web.


HTML,CSS and JavaScript:

Where does HTML fit? I mean what is the role of HTML in web development?

After reading this post, you will be able to answer these simple questions which helps you in making coding decisions precisely.

What does HTML stand for?




HTML stands for “Hyper Text Markup Language”. So let us learn about each one of these words what they mean.

   1.   Hypertext: Hypertext is text which contains links to other texts. That is basically the entire web because in the web we have one document pointing to another document through a unique link. So hypertext is basically just links to other text.





   2.   Markup: Markup means to annotate. Actually it is all about the content. Suppose you have some content like “I am an efficient programmer”. Now you want to annotate the content so as to tell the browser or any other machine or a program what the content is all about. This is what HTML does. It goes and surrounds the content using a set of tags .
      
         Example:
<html>
     <head>
          <title>Efficient programmer</title>
     </head>
          <body>
</body>
</html>   

In the above example, the content “Efficient Programmer” is annotated using <title> tag which specifies to the browser that this is the title of the document.

   3.   Language: The last word in HTML is “language”. It means that there are specific rules and syntax for declaring the tags.

      For example:

<h1>
          <h2>Hello programmer!</h2>
</h2>

This code is invalid because the <h1> tag is not closed properly.

<h1>
          <h2>Hello Programmer!</h2>
</h1>

This code is certainly valid.

In HTML each and every element has a starting tag and an ending tag.

          Example :       <h1></h1>

Let us now take a look at the three technologies that drive the web:




       1.   HTML     2. CSS   3. JavaScript


Html tells you about the structure of your document. For example say your page has a heading, the body section and the footer section.
Html does not provide you any information about how the document is visually seen on the browser.

All the styling that is associated with the document is taken care of by CSS. The styling include changing the font-size, changing the colour of the text, changing the background of your document, inserting images in your document and so on.

The job of javascript is to add behaviour or functionality to the page. For example, what should happen when the user clicks on a button, when the page loads completely, when the user selects some text  and many more.That is the job of javascript , to provide the behaviour.

Let us consider some sample document with and without css styles.

     1.   Without CSS:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <h1>HELLO! Welcome to efficientprogrammer.com</h1>
   <p>This is a great website for programmers and technical enthusiasts.</p>
  </body>
</html>


It is a simple HTML document with a heading tag. No if we try to run the document in a browser, we see the following:




There is nothing amazing here. It is just showing the content of <h1> tag.

Now let us see what happens when we apply the CSS styles to the document.

HTML DOCUMENT WITH CSS.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body style="background-color:#f1f1f1;">
    <center>
    <h1 style="font-size:40px;color:green;">HELLO! Welcome to efficientprogrammer.com</h1>
       <p style="font-size:20px;">This is a great website for programmers and technical enthusiasts.</p>
</center>
  </body>
</html>

In this document we have “style” attribute which specifies the type of style to be applied for the associated tag.

If we try to run this document,we get :




We observe that the background color has been changed. The color of  heading is also changed. 

Summary:

Let us now summarize what we have learnt.

1. HTML
·      It annotates the content.
·      It defines the document structure.

    2. Right and Wrong syntax:  HTML has some syntactical rules which must be followed while coding the document.

    3. Core technologies that drive the WEB.

  •            ·     HTML , CSS and JavaScript.



Comments

Popular posts from this blog

Introduction to Big Data and Hadoop

what Is Big Data?