Translate

Saturday, 14 June 2014

Basics of HTML

Daily you may visit hundreds of websites, ever surprised to make you website by your own.
Generally you may find some online sites that allow you to create your website by your own in few minutes, but it is pre-built and you are going to just change the names  (replace the names you need) in the name fields, Heading, subheading, topics, etc...
Now you are going to learn how to create websites by your own with HTML program.
HTML is a programming language that can be understand by the browsers like Google chrome, Mozilla, Internet explorer,etc..
You need not be a good programmer nor aware of programming you can understand everything simply.
Now you are going to learn only structure of HTML.
Do not except to be a professional by reading a single article, however "something is better than nothing".

You need not download any external softwares to write HTML code.
You just need an Notepad in your pc, thats it...

Structure

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

<h1></h1>

<p></p>

</body>
</html>


Detailed information of above code
<!DOCTYPE html> is a document type html file.
* For every thing you need is open and close i.e < > is called open and < / > is called close.
* Now <html> is opened.
* Your entire source code should be in between html i.e <html> and </html>
   So for that, you need to enter closed html </html> after leaving some lines.
* Now the body of the code starts open and close same as html i.e <body> and </body> with lines of gap like <html>, </html> as displayed above.
* In between html and body there is another line called title, <title></title> it is the title for your website.
* <h1></h1> is the heading of the website
* If you want you can add many sub headings using numbers i.e <h2></h2>, <h3></h3>, <h4></4>..........
* <P></p> represents a paragraph, your text is placed here.



A clear glance

                                                          <!DOCTYPE html>
<html>
<head>
<title>My website</title>
</head>
<body>

<h1>Heading</h1>
<h2>subheading</h2>

<p>Paragraph</p>

</body>
</html>

Now copy this and paste in your notepad.
Note: File should be saved with .htm or .html extension only.
After completing source code in notepad click -->file-->save as
then click file type as "any file" option available below file name.
Open your browser, click (ctrl+o) or file-->open, open your file location and select your file.
Once you have an idea, you can change text in the code.


Start thinking as a programmer....!

 

No comments:

Post a Comment