0% found this document useful (0 votes)
4 views

HTML Guide

HTML guide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

HTML Guide

HTML guide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

HTML Guide: How to Use HTML

1. Introduction to HTML
HTML (HyperText Markup Language) is the standard language for creating web pages. It describes

the structure of a webpage using elements represented by tags.

Basic Structure of an HTML Document:

<!DOCTYPE html>

<html>

<head>

<title>Page Title</title>

</head>

<body>

Content goes here.

</body>

</html>

2. HTML Elements and Tags


HTML elements are the building blocks of HTML pages. They are represented by tags, enclosed in

angle brackets (< >). Examples include <html>, <head>, <body>, <p>, <h1>, etc.

3. Attributes
Attributes provide additional information about elements. They are always included in the opening

tag.

Examples:

<a href='https://example.com'>Link</a>

<img src='image.jpg' alt='Image description'>

4. Basic Formatting
HTML provides tags for text formatting:
<b>Bold</b>, <i>Italic</i>, <u>Underline</u>

5. Lists
HTML supports ordered and unordered lists:

Ordered List (<ol>):

<ol>

<li>Item 1</li>

<li>Item 2</li>

</ol>

Unordered List (<ul>):

<ul>

<li>Item 1</li>

<li>Item 2</li>

</ul>

6. Links and Images


Links are created using the <a> tag:

<a href='https://example.com'>Visit Example</a>

Images are added using the <img> tag:

<img src='image.jpg' alt='Description'>

7. Tables
Tables are created using the <table> tag:

<table>

<tr>

<th>Header 1</th>

<th>Header 2</th>

</tr>
<tr>

<td>Data 1</td>

<td>Data 2</td>

</tr>

</table>

8. Forms
Forms collect user input using various fields:

<form action='/submit'>

<input type='text' name='username'>

<button type='submit'>Submit</button>

</form>

9. CSS Introduction
CSS (Cascading Style Sheets) is used to style HTML elements. Styles can be added inline or

internally:

Inline:

<p style='color: blue;'>Blue Text</p>

Internal:

<style>

p { color: blue; }

</style>

10. HTML Best Practices


1. Use proper indentation.

2. Close all tags.

3. Use semantic tags (e.g., <header>, <footer>, <main>).

You might also like