WEB[1]
WEB[1]
HTML-Introduction
HTML is the backbone of the World Wide Web, providing the structure
for web pages.
In this lesson, we will explore the fundamentals of HTML, learn how to
create a basic HTML document, and understand the essential elements
that make up a web page.
Structure:
• HTML uses a tag-based structure to define elements on a web page.
• Tags are enclosed in angle brackets, such as <tag>.
Tag is a command that tells the web browser how to display the text, audio, graphics or
video on a web page.
e.g.
<html>
<head> Heading goes here…</head>
<title> Title goes here…</title>
<body> Body goes here…</body>
</html>
Key Points:
• Some tags are the empty i.e. they don’t have the closing tag.
• Tags are not case sensitive.
• The starting and closing tag name must be the same. For example <b>
hello </i> is invalid as both are different.
• If you don’t specify the angle brackets (<>) for a tag, the browser will
treat the tag name as a simple text.
• The tag can also have attributes to provide additional information
about the tag to the browser.
II. Basic HTML Document Structure:
a. Document Type Declaration (DOCTYPE):
• Specifies the HTML version being used.
• Example: <!DOCTYPE html> for HTML5.
b. HTML Element:
• The root element that wraps all content on the page.
• Opening tag: <html>
• Closing tag: </html>
II. Basic HTML Document Structure:
c. Head Element:
• Contains meta-information about the HTML document, such as the title and
linked stylesheets.
• Opening tag: <head>
• Closing tag: </head>
d. Body Element:
• Contains the actual content of the web page, such as text, images, and other
elements.
• Opening tag: <body>
• Closing tag: </body>
III. Common HTML Elements:
• a. Headings:
• Used to define headings on a page.
• <h1> to <h6> with <h1> as the highest level and <h6> as the lowest.
• b. Paragraphs:
• <p> is used to define paragraphs.
• c. Links:
• <a> is used to create hyperlinks.
• Example: <a href="https://www.example.com">Visit
Example.com</a>
III. Common HTML Elements:
d. Lists:
• <ul> for unordered lists (bulleted).
• <ol> for ordered lists (numbered).
• <li> for list items.
e. Images:
• <img> is used to embed images.
• Example: <img src="image.jpg" alt="Description">
Table
<table> </table> Specifies a table.
<tr> </tr> Specifies a row in the table.
<input type="submit" value=?> Creates a submit button. Value sets the text
in the submit button.
<input type="image" name=? src=? Creates a submit button using an image.
border=? alt=?>
<input type="color" name=?> Sets a single-line text box for picking a color