HTML Introduction
What is HTML?
HTML is a markup language for describing web documents (web pages).- HTML stands for Hyper Text Markup Language
- A markup language is a set of markup tags
- HTML documents are described by HTML tags
- Each HTML tag describes different document content
HTML Example
A small HTML document:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Try it Yourself »
HTML Editors
Write HTML Using Notepad or TextEdit
HTML can be edited by using a professional HTML editor like:- Adobe Dreamweaver
- Microsoft Expression Web
- CoffeeCup HTML Editor
We believe using a simple text editor is a good way to learn HTML.
Follow the 4 steps below to create your first web page with Notepad.
Step 1: Open Notepad
To open Notepad in Windows 7 or earlier:Click Start (bottom left on your screen). Click All Programs. Click Accessories. Click Notepad.
To open Notepad in Windows 8 or later:
Open the Start Screen (the window symbol at the bottom left on your screen). Type Notepad.
Step 2: Write Some HTML
Write or copy some HTML into Notepad.
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Step 3: Save the HTML Page
Save the file on your computer.Select File > Save as in the Notepad menu.
Name the file "index.htm" or any other name ending with htm.
UTF-8 is the preferred encoding for HTML files.
ANSI encoding covers US and Western European characters only.
Step 4: View HTML Page in Your Browser
Open the saved HTML file in your favorite browser. The result will look much like this:HTML Basic Examples
HTML Documents
All HTML documents must start with a type declaration: <!DOCTYPE html>.The HTML document itself begins with <html> and ends with </html>.
The visible part of the HTML document is between <body> and </body>.
Example
<!DOCTYPE html><html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML Headings
HTML headings are defined with the <h1> to <h6> tags:Example
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
HTML Paragraphs
HTML paragraphs are defined with the <p> tag:Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>/
<p>This is another paragraph.</p>/
HTML Links
HTML links are defined with the <a> tag:Example
<a href="http://www.kumarvijaybaswa.blogspot.com">This is a link</a>
HTML Images
HTML images are defined with the <img> tag.The source file (src), alternative text (alt), and size (width and height) are provided as attributes:
Example
<img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142">
HTML Elements
HTML documents are made up by HTML elements.
HTML Elements
HTML elements are written with a start tag, with an end tag, with the content in between:
<tagname>content</tagname>
The HTML element is everything from the start tag to the end tag:
<p>My first HTML paragraph.</p>
Start tag | Element content | End tag |
---|---|---|
No comments:
Post a Comment