Docsity

Introduction to HTML: Structure, Tags, Attributes, and Metadata, Slides of Web Programming and Technologies

Partial preview of the text

Download Introduction to HTML: Structure, Tags, Attributes, and Metadata and more Slides Web Programming and Technologies in PDF only on Docsity!

Web

Engineering

(HTML)

Lecture # 2

Contents ■ (^) Introduction to HTML ■ Editors ■ (^) A simple HTML Page ■ (^) HTML Tags  (^) HTML, HEAD, TITLE, META, BODY ■ (^) Attributes

HTML Versions

  • HTML Version Year
  • HTML +
  • HTML 2.0
  • HTML 3.2
  • HTML 4.01
  • XHTML
  • HTML5
  • HTML 5.2

HTML Editors—How to code

■ Web pages can be created and modified by

using professional HTML editors.

■ It may be Notepad, Notepad++ or Sublime

Text.

■ Write source code in anyone of these and

save the file with .htm or .html extension.

■ To view the result, Open the saved HTML

file in your favorite browser.

Description  (^) The declaration defines this document to be HTML  (^) The element is the root element of an HTML page.  (^) An HTML document can be divided into two sections. i. Head Section ii. Body Section  (^) The element contains meta information about the document. E.g. title, author, styling etc.  (^) The element specifies a title for the document  (^) The <body> element contains the visible page content. Only the content inside the <body> section is displayed in a browser.  (^) E.g. the text “Welcome to Web Development” will be displayed inside a web page body.

HTML Tags

■ HTML commands are known as tags.

■ HTML tags are element names surrounded by

angle brackets.

■ They normally come in pairs like

and

■ The first tag in a pair is the start tag or

opening tag, the second tag is the end tag

or closing tag.

■ HTML tags are not case sensitive:

means the same as

.

HTML Attributes

■ All HTML elements can have attributes

■ Attributes provide additional

information about an element

■ Attributes are always specified in the start

tag

■ Attributes usually come in name/value pairs

like:

name="value"

lang Attribute ■ (^) The language of the document can be declared in the tag. ■ (^) The language is declared with the lang attribute. ■ (^) Declaring a language is important for accessibility applications (screen readers) and search engines: ■ For example en-US for American English and ur fr urdu.

Title Tag The element defines the title of the document and: ■ (^) defines a title in the browser toolbar ■ (^) provides a title for the page when it is added to favorites ■ (^) displays a title for the page in search-engine results <head> <title>My Website

Also ■ (^) It can be added to the

or heading elements. The value of the title attribute will be displayed as a tooltip when you mouse over the paragraph:

Element ■ (^) The **** element is used to specify which character set is used, page description, keywords, author, and other metadata. ■ (^) Metadata is used by browsers (how to display content), by search engines (keywords), and other web services. ■ Define the character set used: UTF:Unicode Transformation Format

■ (^) Define a description of your web page:

■ (^) Define the author of a page:

■ Refresh document every 30 seconds:

Body Attributes Attribute Value Description backgroun d URL Not supported in HTML5. Specifies a background image for a document bgcolor color Not supported in HTML5. Specifies the background color of a document text color Not supported in HTML5. Specifies the color of the text in a document

Example

Home

Welcome to HTML