Friday, October 3, 2014

Learning html and css (part 1)

HTML is a very usefull language when it comes to making webpages, with the addition of html5 it will soon become even more powerfull because of the diversity it carries. It includes various libraries of javascript and some built in css, which reduces the amount of work to be done to make a cool web page.

We will be starting with html 4 today, but we'll try to keep as short as possible so we can move on to html5 asap :)

CSS is the styling language actually, It is used to style any html webpage. We'll discuss it in detail in upcoming languages.



Okay, To begin with you must know that tags are the most important component of a webpage. To insert any thing on a webpage you need a tag e.g., to insert an image you need an image <img>  tag. for a link you need a link tag and for a button you need a button tag and the list goes on. The way to write a tag is

<tagname>

some tags have an end tag which is like </tagname>

A special tag is used for each webpage called DOCTYPE html tag telling the browser the type of document it is going to look at.

To add a comment in html code we use <!-- comments -->. Anything written between <!-- --> iis treated as a comment and will not displayed in webpage by browser.

Every html webpage has got two parts.
  • head
  • bosy
head is the part where all the browser information goes in, meta tags, keywords, title etc.,

All the stuff we see in a webpage goes in the body. A <p></p> tag is a paragraph tag, which actually tell the browser that it carries a paragraph.

<!DOCTYPE html>
<html>
<head>
<title>My first webpage</title>
</head>
<body>
<p>This is my first webpage</p>
</body>
</html>

copy the above code in notepad and save it with extension .html and then open it with webbrowser. There you go you have written your very first html webpage. Next time we will look at some css styling methods.

No comments:

Post a Comment