
1. Introduction to HTML
- HTML stands for HyperText Markup Language.
- It is the standard language used to create and design webpages.
- HTML is not a programming language, it is a markup language used to structure content.
- HTML uses tags to define elements (like headings, paragraphs, images, links, etc.).
- Web browsers (Chrome, Edge, Firefox) read HTML and display the content accordingly.
2. Features of HTML
- Simple and easy to learn.
- Platform-independent (runs on any operating system).
- Provides structure to web pages.
- Supports multimedia (images, audio, video).
- Works with CSS for styling and JavaScript for interactivity.
- Supported by all modern browsers.
3. Structure of an HTML Document
Every HTML page has a basic structure as shown below:
<!DOCTYPE html> <html> <head> <title>Page Title</title> <meta charset="UTF-8"> </head> <body> <h1>Hello World!</h1> <p>This is my first webpage.</p> </body> </html>
- <!DOCTYPE html> → Defines the document type (HTML5).
- <html>...</html> → Root element of the document.
- <head>...</head> → Contains metadata (title, styles, scripts).
- <body>...</body> → Contains visible page content.
4. Commonly Used HTML Tags
Tag | Meaning | Example |
---|---|---|
<h1> to <h6> | Headings (largest to smallest) | <h1>Welcome</h1> |
<p> | Paragraph | <p>This is a paragraph</p> |
<a href="">...</a> | Hyperlink | <a href="https://www.cbse.gov.in">CBSE</a> |
<img src="" alt=""> | Image | <img src="image.jpg" alt="pic"> |
<br> | Line Break | Hello<br>World |
<ul> <li>...</li> </ul> | Unordered List |
<ul> <li>Apple</li> <li>Mango</li> </ul> |
5. Attributes in HTML
- Attributes provide extra information about HTML tags.
- They are always written inside the opening tag.
- Attributes are written as
name="value"
. - Examples:
- <img src="pic.jpg" width="200" height="150">
- <a href="https://google.com" target="_blank">Google</a>
6. Lists in HTML
- Ordered List (ol) → Numbered list.
- Unordered List (ul) → Bulleted list.
- Definition List (dl, dt, dd) → Terms with definitions.
7. Example HTML Page
<!DOCTYPE html> <html> <head> <title>My First Webpage</title> </head> <body> <h1>Welcome to HTML</h1> <p>This is a simple webpage created using HTML.</p> <h2>My Favorite Fruits</h2> <ul> <li>Apple</li> <li>Mango</li> <li>Banana</li> </ul> <img src="fruit.jpg" alt="Fruits" width="200"><br> <a href="https://www.google.com" target="_blank">Visit Google</a> </body> </html>
8. Importance of HTML
- Backbone of all web pages.
- Defines the structure of websites.
- Works with CSS & JavaScript to make websites attractive and interactive.
- Universal standard supported by all browsers.
Chapter 6: Introduction to HTML Que. & Ans.
Click here to access all Questions & Answers
Visit Now ⤴
No comments:
Post a Comment