html body { margin-top: 50px !important; } #top_form { position: fixed; top:0; left:0; width: 100%; margin:0; z-index: 2100000000; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; border-bottom:1px solid #151515; background:#FFC8C8; height:45px; line-height:45px; } #top_form input[name=url] { width: 550px; height: 20px; padding: 5px; font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif; border: 0px none; background: none repeat scroll 0% 0% #FFF; }
HTML Tag Vs Element
HTML Tag Vs Element
HTML Tag Vs Element
Tag vs.
Element
Learning Objectives
• Know the meaning of and use hypertext terms
• Use HTML tags to structure a document
• Use HTML tag attributes
• Use Cascading Style Sheets to style a Web page
• Use HTML tags to link to other files
• Explain the differences between absolute and
relative pathnames
• Use HTML to encode lists and tables to structure a
Web page
Web Pages
• Web pages are created, stored, and
sent in encoded form
• A browser converts them to what we
see on the screen
• Hypertext Markup Language (HTML) is
the main language used to define how a
Web page should look
• Features like background color, font,
and layout are specified in HTML
Marking Up with HTML
• The words on a Web page are
embellished by hidden formatting
<tags>
• There is XHTML or the Extensible
Hypertext Markup Language
• We will use HTML
• XHTML tags are also HTML tags, but
not vice versa
• There are some parts of the original
HTML that are not part of XHTML
Formatting with Tags
• Tags are words or abbreviations enclosed in
angle brackets, < and >
• Many tags come in pairs
• The second of the pair comes with a
slash:<title> Fluency </title>
• In HTML, the tags may be upper or lowercase
<TITLE>, <Title>, and <tITle> are legal
• XHTML is more restrictive
• The tag pair surrounds the text to be
formatted like parentheses
Formatting with Tags
<title>Serena Williams</title>
• These tags can be read as ―this is where
the title starts‖ and ―this is where the
title ends‖
• <title> is referred to as the start or open
tag
• </title> is the end or close tag
• The title appears on the title bar of the
browser
Tags for Bold and Italic
• HTML has tags:
– for bold text, <b> and </b>
– for italic text, <i> and </i>
– for underlining text, <u> and </u>
– for paragraphs, <p> and </p>
• More than one kind of formatting can be
used at a time:
<p><b><i>Veni, Vidi, Vici!</i></b></p>
produces
Veni, Vidi, Vici!
Tags for Bold and Italic
• It doesn‟t matter in which order you start
the tags: italic follows bold, or bold follows
italic
• You get the same result
• The rule is to make sure the tags “nest”
correctly…they should mirror each other
• All the tags between a starting tag and its
ending tag should be matched
Singleton Tags
• A few tags are not paired
• They do not have a matching ending tag
• For those tags, the closing angle bracket
> of the singleton tag is replaced by /> in
XHTML
• In HTML there is no special notation
• Examples:<hr> produces a horizontal line
• <br>
continues the text on the next line
More Formatting Tags
• Documents can be formatted in many
ways
• Each formatting feature requires its
own tag
• Programmers and Web designers need
to remember a few common tags
• Uncommon tags can be looked up:
www.w3schools.com/tags/default.asp
Required Tags
• HTML tags that are required for every
Web page:
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
Required Tags
<head> • The head section
<title>Starter contains the
</title>other stuff beginning material
goes here…that will like the title and
come later other information
</head> that applies to the
whole page
Required Tags
<body> • The body section
contains the content
the main content of of the page.
the page goes here
</body> • This <html> <head>
<body> form must
always be followed
• All of these tags are
required
Configure Your Computer for
Writing HTML
• Check that two programs are installed:
– A browser (check for Firefox)
– A text editor (Notepad++ for Windows or Text
Wrangler for Macs)