Introduction to HTML What is a HTML File

  • Slides: 21
Download presentation
Introduction to HTML

Introduction to HTML

What is a HTML File? HTML stands for Hyper Text Markup Language ¢ An

What is a HTML File? HTML stands for Hyper Text Markup Language ¢ An HTML file is a text file containing small markup tags ¢ The tags tell the built in function in the web browser how to structure the text. For instance put text in a bold font. ¢

What is a HTML File? The markup tags tell the Web browser how to

What is a HTML File? 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 ¢

When you learn a language, you need to learn rules, called syntax Elements to

When you learn a language, you need to learn rules, called syntax Elements to define the structure of the document ¢ Examples of elements are: head, body, p, ul ¢

¢ When you insert these elements in your text you surround them with <

¢ When you insert these elements in your text you surround them with < (less than) and > (greater than) symbols. You now have <head>, <body>, <p> and <ul>. These are no longer elements; they are now called tags.

Type in the following text in a simple text editor: <html> <head> <title>Title of

Type in the following text in a simple text editor: <html> <head> <title>Title of page</title> </head> <body> This is my first homepage. <b>This text is bold</b> </body> </html>

Example Explained The first tag in your HTML document is <html>. This tag tells

Example Explained 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.

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

¢ ¢ The text between the <head> tag and the </head> tag is header information. Header information is not displayed in the browser window. The text between the <title> tags is the title of your document. The title is displayed in your browser's caption. The text between the <body> tags is the text that will be displayed in your browser. The text between the <b> and </b> tags will be displayed in a bold font.

¢ ¢ Save the file as "mypage. html". Start your Internet browser. Select "Open"

¢ ¢ Save the file as "mypage. html". 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: My. Documentsmypage. html". Click OK, and the browser will display the page. Or write the path in the address window. E. g. C: My. Documentsmypage. html. Or double-click on icon

HTML Tags ¢ ¢ ¢ ¢ HTML tags are used to mark-up HTML elements

HTML Tags ¢ ¢ ¢ ¢ HTML tags are used to mark-up HTML elements HTML tags are surrounded by the two characters < and > The surrounding characters are called angle brackets HTML tags normally come in pairs like <b> and </b> The first tag in a pair is the start tag, the second tag is the end tag The text between the start and end tags is the element content HTML tags are not case sensitive, <b> means the same as <B>

This is an HTML element: <b>This text is bold</b> ¢ ¢ The HTML element

This is an HTML element: <b>This text is bold</b> ¢ ¢ The HTML element starts with a start tag: <b> The content of the HTML element is: This text is bold. The HTML element ends with an end tag: </b> The purpose of the <b> tag is to define an HTML element that should be displayed as bold.

Comments in HTML <!-- This is a comment --> ¢ ¢ The comment tag

Comments in HTML <!-- This is a comment --> ¢ ¢ 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 you when you edit the source code at a later date. Note that you need an exclamation point after the opening bracket, but not before the closing bracket.

Basic HTML Tags Tag Description ¢ ¢ ¢ ¢ <html> Defines an HTML document

Basic HTML Tags Tag Description ¢ ¢ ¢ ¢ <html> Defines an HTML document <body> Defines the document's body <h 1> to <h 6> Defines header 1 to header 6 <p> Defines a paragraph Inserts a single line break <hr> Defines a horizontal rule <!--> Defines a comment

Adding images with the IMG element Use the IMG element to add an image

Adding images with the IMG element Use the IMG element to add an image to your page simply. The IMG element includes everything you need in the start tag and does not have end tags. <IMG src=“images/seeds. jpg” alt=“picture of seeds” height=“ 100” width=“ 100”> src: URL of image Alt: short description Height, width: height and width of image

To publish a website on the internet – if you want it to be

To publish a website on the internet – if you want it to be seen by others ¢ ¢ If you have a internet service provider you often have a space on their web server to publish your sites To transfer your files to a web hotel you need a FTPprogram (file transfer protocol) You often need hostname, user Id, password Call the first page (start page) index. html. The web server is then automatically sending this site when someone is asking for the url-address.

How to retrieve a web page Ask for certain address client Web server The

How to retrieve a web page Ask for certain address client Web server The web server finds the document and sends it back to the client computer.

More to read about HTML on the internet ¢ Links to tutorial from your

More to read about HTML on the internet ¢ Links to tutorial from your web site ¢