20
HTML Hyper Text Markup Language

HTML Hyper Text Markup Language. What is an HTML File? HTML stands for Hyper Text Markup Language An HTML file is a text file containing small markup

Embed Size (px)

Citation preview

Page 1: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

HTML

Hyper Text Markup Language

Page 2: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

What is an HTML File?

HTML stands for Hyper Text Markup Language

An HTML file is a text file containing small markup tags

The markup tags tell the Web browser how to display the page

An HTML file must have an .htm or .html file extension

An HTML file can be created using a simple text editor

Page 3: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Do You Want to Try It? If you are running Windows, start Notepad. Type in the following text:

<html>

<head> <title>Title of page</title> </head>

<body> This is my first homepage.</body> </html>

Page 4: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Saving your file Please create a new folder in your Z:

drive and call it HTML_Folder Go back to your notepad document

and select File \ Save as Change the Save as type to All

Files Enter a File name: “mypage”

followed by “.” and “htm” Click Save

Page 5: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Opening your file in a Browser 

Open your HTML_Folder Right click on your mypage.htm file

and select open with: Select Internet Explorer IE should now open and you should

see an address in the dialog box:

Z:\HTML_Folder\mypage.htm

Page 6: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Try this at Home!!!Opening your file in a Browser  Start your Internet browser. Select "Open" (or "Open Page") in the File

menu of your browser. A dialog box will appear.

Select "Browse" (or "Choose File") and locate the HTML file you just created - "mypage.htm" - select it and click "Open".

Now you should see an address in the dialog box, for example "C:\MyDocuments\mypage.htm".

Click OK, and the browser will display the page.

Page 7: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

What do the tags mean.

The first tag in your HTML document is <html>. This tag tells your browser that this is the

start of an HTML document. The last tag in your document is

</html>. This tag tells your browser that this is the

end of the HTML document.

Page 8: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

The <head> tag

The text between the <head> tag and the </head> tag is header information.

The head element can contain information about the document. 

The browser does not display the "head information" to the user.

Page 9: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

The <title> tag

This element defines the title of the document.

You will see the title on the top bar of your browser when you open the page.

The title will also be used as the name of the link in your favorites.

Page 10: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

The <body> tag

The text between the <body> tags is the portion of your html document that will be displayed in your browser.

It contains all the contents of the document (like text, images, colors, graphics, etc.).

Page 11: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

HTM or HTML Extension?

When you save an HTML file, you can use either the .htm or the .html extension.

I have used .htm in my examples. The use of the .htm goes back to the

8.3 notation which was used in DOS.

Page 12: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

The <h1> to <h6> tags Headings are defined with the <h1> to <h6> tags. <h1> defines the largest heading. <h6> defines the smallest heading.

<h1>This is a heading</h1>

<h2>This is a heading</h2>

<h3>This is a heading</h3> <h4>This is a heading</h4> <h5>This is a heading</h5> <h6>This is a heading</h6>

HTML automatically adds an extra blank line before and after a heading.

Page 13: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

The <p> tag

Paragraphs are defined with the <p> tag.

<p>This is a paragraph</p> <p>This is another paragraph</p>

HTML automatically adds an extra blank line before and after a paragraph.

Page 14: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

The <br> tag The line break <br> tag is used when you

want to end a line, but don't want to start a new paragraph. The <br> tag forces a line break wherever you place it.

<p>This <br> is a para<br>graph with line breaks</p>

Thisis a paragraph with line breaks

The <br> tag is an empty tag. It has no closing tag.

Page 15: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

The <hr> tag

The <hr> tag inserts a horizontal rule.______________________________

The <hr> tag should be closed Does this make sense <hr></hr> Try this instead <hr />

Page 16: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Comments in HTML The comment tag is used to insert a

comment in the HTML source code. A comment will be ignored by the browser. You can use comments to explain your

code, which can help when you edit the source code at a later date.

<!-- This is a comment -->

Note that you need an exclamation point after the opening bracket, but not before the closing bracket.

Page 17: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Basic HTML Tags Tag Description <html> Defines an HTML document <body> Defines the document's

body <h1> to <h6> Defines header 1 to header 6 <p> Defines a paragraph <br> Inserts a single line break <hr> Defines a horizontal rule <!--> Defines a comment

Page 18: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

How to View HTML Source

Have you ever seen a Web page and wondered "How do they do that?"

To find out, simply click on the VIEW option in your browsers toolbar and select SOURCE or PAGE SOURCE. This will open a window that shows you the actual HTML of the page.

Page 19: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Here are some Text Formatting Tags

Tag Description <b> Defines bold text <big> Defines big text <em> Defines emphasized text  <i> Defines italic text <small> Defines small text <strong> Defines strong text <sub> Defines subscripted text <sup> Defines superscripted

text <ins> Defines inserted text <del> Defines deleted text

Page 20: HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup

Create your own web page Set the file name as “FirstName.htm” Set the title as “FirstName LastName First

Web Site” Use the following format for your page:

NameComputer TechPeriod ___----------------------------------------------Use several horizontal rules on the pageWrite three short paragraphs about creating a web page. Use at least four of the Text Formatting Tags in your paragraphs. Include a list of tags using line breaks to separate them.