HTML Documents
Create HTML Documents
HTML documents are text files containing html tags. HTML tags in HTML documents mark up Web pages.
Save the following to a text file named index.htm, and drag and drop it to a browser.
<!DOCTYPE HTML>
<html>
<body>
<h1>My Heading</h1>
<p>My paragraph</p>
</body>
</html> <!--from w w w. ja v a2 s. c om-->
The HTML document starts with <!DOCTYPE HTML>. <!DOCTYPE HTML> tells the browser this is a html document.
The content between <html>
and </html>
marks the Web page.
<body>
and </body>
makrs the visible page content.
<h1>
and </h1>
is uses to define a heading.
<p>
and </p>
creates a paragraph.
The code above generates the following result.
HTML CSS Tutorial HTML CSS Basic
HTML Introduction
HTML Attributes
HTML Core Attributes
HTML Comments
HTML Headings
HTML Paragraphs
HTML Rules (Lines)
HTML Line Breaks
CSS Introduction
CSS Syntax
CSS Color
CSS Lengths
CSS Comments
CSS selector
Grouping/nesting Selectors
Add CSS to HTML
Compare em measurement and pixel measuremen...
Select class along with tag name in HTML an...
Select Next Sibling with Next Sibling Selec...
Select with Descendant Selectors in HTML an...
Set color to purple in HTML and CSS
Set color with rgb function in HTML and CSS
Set text color for body element in HTML and...
Show the difference between block and inlin...
HTML Introduction
HTML Documents
HTML ElementHTML Attributes
HTML Core Attributes
HTML Comments
HTML Headings
HTML Paragraphs
HTML Rules (Lines)
HTML Line Breaks
CSS Introduction
CSS Syntax
CSS Color
CSS Lengths
CSS Comments
CSS selector
Grouping/nesting Selectors
Add CSS to HTML
Compare em measurement and pixel measuremen...
Select class along with tag name in HTML an...
Select Next Sibling with Next Sibling Selec...
Select with Descendant Selectors in HTML an...
Set color to purple in HTML and CSS
Set color with rgb function in HTML and CSS
Set text color for body element in HTML and...
Show the difference between block and inlin...