>> introduction to html: tags. hyper - is the opposite of linear text – words / sentences /...

19
>> Introduction to HTML: Tags

Upload: alvin-walton

Post on 16-Jan-2016

242 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

>> Introduction to HTML: Tags

Page 2: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 2

• Hyper - is the opposite of linear• Text – words / sentences / paragraphs• Mark-up – Marking the text• Language – It is a language

• It is used to display content you read and see on the web.

HTML - Definition

Page 3: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 3

• An HTML document is comprised of one word commands enclosed between the less than (<) and greater than (>) sign

• Determine how the page is handled

• Also called “TAGS”

• Tags nearly always come in pairs: – an opening tag <html>– a closing tag </html>

How to write HTML?

Page 4: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 4

<h2 style=“background-color:#ff0000;” >My First HTML Class </h2>

Element

Start Tag ContentEnd Tag

Attribute

Tag Structure

HTML TAGS

element = <opening tag> + content + <closing tag>

Page 5: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 5

HTML Structure

• 5 Important HTML Tags you should know before coding an HTML document

– DOCTYPE– HTML– HEAD– TITLE– BODY

Page 6: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-based Systems | Misbhauddin 6

Empty HTML Document

<!DOCTYPE html><html>

<head><title>

</title> </head>

<body>

</body></html>

Page 7: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 7

• DOCument TYPE• Should be placed at the start of each web page • Shows which standard the page complies with

DOCTYPE Tag

HTML ver. 4.1

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

HTML ver. 5

<!DOCTYPE html>

Page 8: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 8

• Root Element / Tag• Contains all tags that will be used in an HTML document• Necessary• Attribute “lang”

– define the language of the content within the document

HTML Tag

<html lang=“en”>

</html>

Page 9: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 9

• Provide information about the author, title and description of the page

• Also includes links to other scripting languages such as CSS and JavaScript

• meta tags (like keywords used by search engines)

• Includes the <title> tag– Includes a descriptive title of your web page

HEAD Tag

Page 10: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 10

• Contains information that will be displayed on the web– Text, Images, Videos, Ads, Links etc.

BODY Tag

Page 11: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 11

• Create a new html file and call it “mypage.html”

• Add the five required tags – doctype, html, head, title and body

• Add the title text as “My Personal Page”

TRY NOW

Page 12: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 12

• Content wrapped within a comment will not be displayed on the web page

• Comments help keep our files organized• Comments become especially useful when there are

multiple people working on the same files

Comments in HTML

• HTML comments start with <!-- and end with --> HTML comments start with <!-- and end with --> HTML comments start with <!-- and end with -->

HTML comments start with <!-- and end with --> HTML comments start with <!-- and end with -->

HTML comments start with <!-- and end with -->

<!-- This is a comment in HTML -->

EXAMPLE

Page 13: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-based Systems | Misbhauddin 13

TEXT-BASED ELEMENTSIN HTML

Page 14: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 14

<h1>the biggest heading</h1><h2>the second biggest heading</h2>………………………<h6>the smallest heading</h6>

Heading Tags

• Create a <h3> sized heading in the body• Make the heading as “My Contact Info (Just don't forget to close it)

TRY NOW

Page 15: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 15

Enclosed between the <p> and </p> tags

Paragraph Tag

• Create three paragraphs using <p> tags • Fill them with content

• Address• Telephone• Email Address

TRY NOW

Page 16: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 16

– To make text bold and place a strong importance on it

– Enclosed between the <strong> and </strong> tags

Bold Tag

• For each of the <p> added before• Bold the titles

• Address• Telephone• Email Address

TRY NOW

Page 17: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 17

– To italicize text, thereby placing emphasis on it

– Enclosed between the <em> and </em> tags

Italics Tag

• For each of the <p> added before• Italicize the content of each of them TRY NOW

Page 18: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 18

HTML Elements

Paired Elements Void Elements

• Has both starting & ending tags• Example

• Header Tags• Paragraph Tags

• No End Tag• No Content• Self-Closes

Page 19: >> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language

Web-Based Systems - Misbhauddin 19

• HTML is used to give websites structure.• We open HTML files using a browser, and the

browser renders(shows us) the file.• HTML files have a <head> and a<body> (just like

you!)• In the head, we have the <title>tags, and we use

these to specify the webpage's name.• How to make headings and paragraphs.• How to bold and italicize text on the page

Summary