HTML
HTML
Ms. Sangeetha J
Asst. Professor
St. Albert’s College (Autonomous)
HTML
HTML stands for Hyper Text Markup Language, which is the most
widely used language on Web to develop web pages.
Markup language is used to define the text document within tag which
defines the structure of web pages
HTML was created by Berners-Lee in late 1991 but "HTML 2.0" was the
first standard HTML specification which was published in 1995
HTML is called markup language because its tags tells the web browser how to display the content within tags.
HTML
HTML describes the structure of a Web page
Browsers do not display the HTML tags, but use them to render the
content of the page
Features of HTML
It is easy to learn and easy to use.
It is platform independent.
It is a markup language.
<html>
<head>
<title>
</head>
<body>
...Document content and markup go here....
</body>
</html>
<html> …. </html> tag
The <html>tag delimits the beginning and the end of an
HTML document
Only one body element can appear per document. Because the
body element delimits the document itself, its attributes are
primarily used to effect change across the entire document,
such as setting background images, background colors, and link
and text color.
Simple Web Page
<html>
<head>
</head>
<body>
Welcome to my page
</body>
</html>
How to create an HTML page
Type the HTML code in text editors like Notepad,
TextEdit etc
Every elements start with < (less than sign) and ends with > (greater than sign)
The browser will not read any line which are in written under the comment tags
<body text=“color”>
link
The font tag is having three attributes called size, color, and face to customize your
fonts.
3) Write a code to create a web page using font color, font face, font face and background
color (Title of the page – font attributes)
4) Write a codes to create a web page using Paragraph tags such as P tag and BR tag
The definition list is the ideal way to present a glossary, list of terms, or other
name/value list.
It can create hyperlink to other web page as well as files, location, or any
URL.
The "href" attribute is the most important attribute of the HTML a tag
and which links to destination page or URL.
The href attribute is used to define the address of the file to be linked
Text Links (Hyperlink)
The syntax is
HTML img tag is an empty tag that contains attributes only, closing tags are
not used in HTML image element.
Attributes of <img>
src
Alt
The alt attribute defines an alternate text for the image, if it can't be displayed.
The value of the alt attribute describe the image in words.
Attributes of <img>
Width
It is an optional attribute which is used to specify the width to display the image.
Height
Eg : <img src="good_morning.jpg" alt="Good Morning Friends">
Tables in HTML
HTML <table> tag is used to display data in tabular form
Background
Bordercolor
The syntax is
<table cellpadding=“value">
The syntax is
<table cellspacing=“value">
<tr> <tr>
<th>Language</th> <td>Germany</td>
</tr> </tr>
<tr> <tr>
<td>John</td> <td>French</td>
<td>English</td> </tr>
</table>
Colspan
The colspan attribute in HTML is used to set the number of columns a
cell should span in a table.
<head>
<title>HTML marquee Tag</title>
</head>
<body>
<marquee>This is basic example of marquee</marquee>
<marquee direction = "up">The direction of text will be from bottom to top.</marquee>
</body>
</html>
HTML Forms
An HTML form is used to collect user input
HTML form facilitates the user to enter data that is to be sent to the server
for processing such as name, email address, password, phone number, etc. .
Method
The method attribute specifies the HTTP method to be used when submitting the form
data.
The form-data can be sent as URL variables (with method="get") or as HTTP post
transaction (with method="post").
The default HTTP method when submitting form data is GET.
Eg : <form action="action_page.html" method="get">
HTML Form Attributes
GET
Get method Appends the form data to the URL, in name/value pairs
POST
POST method Appends the form data inside the body of the HTTP request
(the submitted form data is not shown in the URL)
HTML Form Elements
Text input
Check Box
Radio Box
Select Box