Presentation1 (2)
Presentation1 (2)
• <head>
• <title>Title of page
• </title>
• </head>
• <body>This is my first homepage.
• <b>This text is bold</b>
• </body>
• </html>
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>
• <html>
• <head>
• <title>Title of page
• </title>
• </head>
• <body>This is my first homepage.
• <b>This text is bold </b>
• </body>
• </html>
Why do We Use Lowercase Tags?
• We have just said that HTML tags are
not case sensitive: <B> means the
same as <b>. If you want to follow the
latest web standards, you should
always use lowercase tags. The
World Wide Web Consortium (W3C)
recommends lowercase tags in their
HTML 4 recommendation, and
XHTML (the next generation HTML)
demands lowercase tags.
Tag Attributes
• Tags can have attributes. Attributes provide
additional information to an HTML element.
• Attributes always come in name/value pairs like
this: name="value".
• Attributes are always specified in the start tag of
an HTML element.
• Attributes and attribute values are also case-
insensitive. However, the World Wide Web
Consortium (W3C) recommends lowercase
attributes/attribute values in their HTML 4
recommendation, and XHTML demands
lowercase attributes/attribute values.
Always Quote Attribute Values
• Attribute values should always be
enclosed in quotes. Double style
quotes are the most common, but
single style quotes are also
allowed.
• In some rare situations, like when
the attribute value itself contains
quotes, it is necessary to use single
quotes:
Headings
• Headings are defined with the <h1> to <h6>
tags. <h1> defines the largest heading. <h6>
defines the smallest heading.
• <h1>This is a heading</h1>
• <h2>This is a heading</h2>
• <h3>This is a heading</h3>
• <h4>This is a heading</h4>
• <h5>This is a heading</h5>
• <h6>This is a heading</h6>
• HTML automatically adds an extra blank line
before and after a heading.
Paragraphs
• Example:
• <html>
• <body>
• <form action="">
• First name:
• <input type="text" name="firstname">
• <br>
• Last name:
• <input type="text" name="lastname">
• </form>
• </body>
• </html>
Username:
• <html>
• <body>
• <form action="">
• Username:
• <input type="text" name="user">
• <br>
Password:
• <html>
• <body>
• <input type="password" name="password">
• </form>
• <p>
• Note that when you type characters in a
password field, the browser displays asterisks
or bullets instead of the characters.
• </p>
• </body>
• </html>
• Text fields are used when you want the
user to type letters, numbers, etc. in a
form.
• <form>
• First name:
• <input type="text" name="firstname">
• <br>
• Last name:
• <input type="text" name="lastname">
• </form>
Radio Buttons
Radio Buttons are used when you
want the user to select one of a
limited number of choices.
<form>
<input type="radio" name="sex" value="male">
Male
<br>
<input type="radio" name="sex" value="female">
female
</form>
Checkboxes
Checkboxes are used when you want the user
to select one or more options of a limited
number of choices.
• <form>I have a bike:
• <input type="checkbox" name="vehicle"
value="Bike" />
• <br />I have a car:
• <input type="checkbox" name="vehicle"
value="Car" />
• <br />I have an airplane:
• <input type="checkbox" name="vehicle"
value="Airplane" />
• </form>
The Form's Action Attribute and the
Submit Button
• When the user clicks on the "Submit"
button, the content of the form is sent to
another file.
• Emphasis <em>
• Strong emphasis <strong>
• Code <code> -- fixed width ( Courier) font.
• Variable name <var>
• Definition <dfn>
• Citation <cite>
• Address <address>
Physical Character formatting
• Bold <b>
• Italics <i>
• Underline <u>
• Fixed width <tt>
• Strike Through <s>
• Bigger print <big>
• Smaller print <small>
• Subscript <sub>
• Superscript <sup>
Special Characters