03-07-2009, 11:12 AM
HTML Basics
Editor for HTML
Notepad is best editor for HTML. Open a notepad file and write your HTML script there and then save your file with “.htm” or “.html” extension and then open it with browser.
Basic Elements of HTML
There are four elements of HTML; Tags, elements, attributes and values.
Basics of HTML Layout
All HTML information begins with an open angle bracket "<" and ends with a closing angle bracket ">", for example, <html>. This tag tells an HTML interpreter (browser) that the document is written and marked up in standard HTML. The <html> tag is a paired tag, however, so you need to add a close tag at the end of the document, which is the same as the open tag with the addition of a slash: </html>.
Breaking at Paragraphs and Lines
To specify that you want a paragraph break, use the <p> tag. The open tag appears before the passage to be affected, and the close tag appears at the end of the passage. To break lines in HTML, use the break tag <br > and <br /> for a break can be used here also. By adding the <pre> tags, you achieve the desired formatting.
Head and Body
You will use the paired tags <head> </head> and <body> </body> to surround each section.
The <head> </head> and <body> </body> formatting information doesn’t add anything to the display. The document also doesn’t contain any introductory HTML-formatting information yet, so the head area is empty.
Adding a Title
The <title> tag enables you to define the exact title you want in the document. It is a paired tag and appears within the <head> </head> block of information.
Adding Blockquote
The tag mostly use for this contact information is <blockquote>. It’s a paired tag
Defining Section Heads
Each header-format level has an open and close tag. The highest-level header-format tag is h1 to the lowest is h6. Used as
Horizontal Rule
A very useful tag for organizing your document visually is the horizontal rule tag: <hr >. Dropped anywhere in a Web document, it produces a skinny line across the page. <hr /> can also be used.
XHTML
The best way to think about XHTML is that it’s a formalized version of HTML.
• All tags are paired or have ”/>” ending.
• All attributes are quoted.
• All attributes must be presented as name=value pairs.
• All tags and attributes must be in lowercase only.
Editor for HTML
Notepad is best editor for HTML. Open a notepad file and write your HTML script there and then save your file with “.htm” or “.html” extension and then open it with browser.
Basic Elements of HTML
There are four elements of HTML; Tags, elements, attributes and values.
Basics of HTML Layout
All HTML information begins with an open angle bracket "<" and ends with a closing angle bracket ">", for example, <html>. This tag tells an HTML interpreter (browser) that the document is written and marked up in standard HTML. The <html> tag is a paired tag, however, so you need to add a close tag at the end of the document, which is the same as the open tag with the addition of a slash: </html>.
Breaking at Paragraphs and Lines
To specify that you want a paragraph break, use the <p> tag. The open tag appears before the passage to be affected, and the close tag appears at the end of the passage. To break lines in HTML, use the break tag <br > and <br /> for a break can be used here also. By adding the <pre> tags, you achieve the desired formatting.
Code:
<html>
Dear HoneX TecH <br>
Link Road Lahore
<p>
Dear Director,
</p><p>
Thank you for giving me chance to learn HTML.
</p><p>
Sincerely,
</p><pre>
Your Name
Your Student
</pre></html>Head and Body
You will use the paired tags <head> </head> and <body> </body> to surround each section.
Code:
<html>
<head>
</head>
<body>
Dear HoneX TecH <br >
Link Road Lahore
<p>
Dear Director,
</p><p>
Thank you for giving me chance to learn HTML.
</p><pre>
Sincerely,
Your Student
</pre>
</body>
</html>Adding a Title
The <title> tag enables you to define the exact title you want in the document. It is a paired tag and appears within the <head> </head> block of information.
Code:
<head>
<title>My First Page</title>
</head>Adding Blockquote
The tag mostly use for this contact information is <blockquote>. It’s a paired tag
Code:
<blockquote> information </blockquote>Defining Section Heads
Each header-format level has an open and close tag. The highest-level header-format tag is h1 to the lowest is h6. Used as
Code:
<h1> sample </h1>
<h2> sample </h2>
<h3> sample </h3>
<h4> sample </h4>
<h5> sample </h5>
<h6> sample </h6>Horizontal Rule
A very useful tag for organizing your document visually is the horizontal rule tag: <hr >. Dropped anywhere in a Web document, it produces a skinny line across the page. <hr /> can also be used.
XHTML
The best way to think about XHTML is that it’s a formalized version of HTML.
• All tags are paired or have ”/>” ending.
• All attributes are quoted.
• All attributes must be presented as name=value pairs.
• All tags and attributes must be in lowercase only.