Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.

Similar presentations


Presentation on theme: "HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag."— Presentation transcript:

1 HTML Tutorial

2 What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag describes different document content

3 HTML tags HTML tags are keywords (tag names) surrounded by angle brackets: content HTML tags normally come in pairs like and The first tag in a pair is the start tag, the second tag is the end tag The end tag is written like the start tag, but with a slash before the tag name

4 Starting an HTML page All HTML documents must start with a type declaration: The declaration helps the browser to display a web page correctly

5 Core HTML tags The HTML document itself begins with and ends with The element is a container for metadata (data about data). HTML metadata is data about the HTML document. Metadata is not displayed. Metadata typically define document title, styles, links, scripts, and other meta information The visible part of the HTML document is between and

6 Example Page Title My First Heading My first paragraph

7 HTML Basics HTML headings are defined with the to tags: This is a heading HTML paragraphs are defined with the tag: This is a paragraph. HTML links are defined with the tag: This is a link

8 HTML Basics (continued) HTML images are defined with the tag. The source file (src), alternative text (alt), and size (width and height) are provided as attributes:

9 How to write a tag HTML elements are written with a start tag, with an end tag, with the content in between: content The HTML element is everything from the start tag to the end tag: My first HTML paragraph.

10 Nested elements HTML elements can be nested (elements can contain elements). All HTML documents consist of nested HTML elements Example: (nested inside the element) My First Heading (nested inside the element) My first paragraph. (nested inside the element)

11 HTML Attributes Attributes provide additional information about the HTML elements in which they are used HTML elements can have attributes Attributes provide additional information about an element Attributes are always specified in the start tag Attributes come in name/value pairs like: name="value"

12 HTML Attributes (Examples) HTML links are defined with the tag. The link address is specified in the href attribute: This is a link HTML images are defined with the tag. The filename of the source (src), and the size of the image (width and height) are all provided as attributes:

13 The HTML Style Attribute Setting the style of an HTML element, can be done with the style attribute. The HTML style attribute has the following syntax: style=“property:value;” The property is a CSS property. The value is a CSS value This is a heading This is a paragraph.

14 Script tag T he tag is used to define a client-side script, such as a JavaScript. The element either contains scripting statements or it points to an external script file through the src attribute Example: document.getElementById("demo").innerHTML = "Hello JavaScript!";

15 HTML Comment Tags Comments are not displayed by the browser, but they can help document your HTML With comments you can place notifications and reminders in your HTML Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors

16 Frequently used HTML tags : used to create links to pages or files : used to insert images in the HTML page,,, : used to create a table in your HTML page : defines a division or a section in an HTML document : defines an ordered list. An ordered list can be numerical or alphabetical : defines an unordered (bulleted) list : defines a list item

17 Frequently used HTML Form tags : used to create an HTML form for user input : specifies an input field where the user can enter data : defines a multi-line text input control : defines a clickable button : used to create a drop-down list : inside the element, defines the available options in the list : defines a label for an element. The element does not render as anything special for the user. However, it provides a usability improvement for mouse users, because if the user clicks on the text within the element, it toggles the control.

18 Working with Forms HTML forms are used to collect user input. The element defines an HTML form defines a button for submitting a form to a form-handler The form-handler is typically a server page with a script for processing input data The form-handler is specified in the form's action attribute: Example:

19 Working with Forms (continued) The action attribute of the form tag defines the action to be performed when the form is submitted The common way to submit a form to a server, is by using a submit button Normally, the form is submitted to a web page on a web server The method attribute specifies the HTTP method (GET or POST) to be used when submitting the forms:

20 Working with Forms (continued) To be submitted correctly, each input field must have a name attribute Example: First name: Last name:

21 Using the input tag in a Form The element is the most important form element. The element has many variations, depending on the type attribute TypeDescription textDefines normal text input radioDefines radio button input (for selecting one of many choices) submitDefines a submit button (for submitting the form) passwordDefines a password field checkboxDefines a checkbox buttonDefines a button


Download ppt "HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag."

Similar presentations


Ads by Google