Lecture 2 of HTML


Writing the first program in HTML







Open the Notepad. And start writing the Code.

first program in html
syntax






Then save the program with html extension like “first.html”



html program .html


Syntax and Hello World program:
<html>
<head>
<title>First Program</title>   <--This is the title of the tab or web page -->
</head>
<body>
Hello World in HTML
</body>
</html>



Run the program open where save the file and open the file that were save with html extention.


Html hello world program






Tags used in first program.

<html>
Indicate that this is a html file and totally code will be write between these tags. i.e <html>Total code</html>
<head>
Title and many other file were include in head tag and it the above part of the output screen as the where the name of the file were written that is “First Program”
<title>
It indicated the file name.
<body>
The main code were in written in body tag.


Attributes:-
                           The additional information for a tag is called a attribute of that tag.
The attributes were written with the starting tag like <tag attribute= ‘ ‘> Any thing</tag>
       
Some attributes for body tag are:

BGCOLOR : It specifies background color of the web page.

BACKGROUND : it specifies the background picture of the web page.

TEXT : it specifies the color that are used in the web page by default it is black.

Example that uses above attributes:

<html>
<head>
<title>Body attributes</title>
</head>
<body BGCOLOR='red' TEXT='white'>
As we see the background color is Red and text color is White
</body>
</html>

Now if we want to use an image as a background so see below code:

<html>
<head>
<title>Body attributes</title>
</head>
<body BACKGROUND='myPhoto.jpg' TEXT='red'>
As we see the background image and text color is Red
</body>
</html>

Note: The image and coded file must be in same directory and folder.




No comments:

Post a Comment

Thank you for choosing https://www.htmlcodzz.com
We have receive your message and response very soon..