XHTML PPT PPSX
XHTML PPT PPSX
Line Breaks
Sometimes text requires a line break
without the preceding blank line. This
is done by break tag.
The break tag differs syntactically
from paragraph tag in that it can
have no content and therefore no
closing tag.
The break tag is specified as<br />.
The slash indicates that it is both
opening and closing tag. The space
before the slash represents the
absent content.
Block quotations
Sometimes we want a block of text
to be set off from normal flow of text
in a document. In most of cases such
a block is a long quotation.
The <blockquote> tag is designed
for this situation.
Browse designers determine how the
content of tag can be made to look
different from surrounding text.
Character
Entity
Meaning
&
&
Ampersand
<
<
Is less than
>
>
Is greater than
"e;
Double quote
'
Single quote
¼
One quarter
½
One half
¾
Three quarters
°
Degree
{space}
Nonbreaking space
Horizontal Rules
The parts of document can be
separated from each other by
placing horizontal lines between
them.
Such lines are called horizontal rules
and the block tag creates them is
<hr />. The <hr /> tag causes a line
break and places a line across the
screen.
The browser chooses the thickness,
length and horizontal placement of
the line.
An example is
<meta name=keywords content=binary
trees, linked lists, stacks />
Web search engines use the information
provided with meta element to categorize
web documents
Images
The inclusion of images can dramatically
enhance its appearance of web document.
The image is stored in a file, which is
specified by XHTML request, inserted into
display of the document by the browser.
Image Formats
Graphic Interchange Format(GIF)- 8 bit color
representation for a pixel
Joint photographic Experts Group(JPEG)- 24 bit
representation for a pixel.
Portable Network Graphics(PNG)
The <img / > tag
This is an inline tag, specifies an image that is
to appear in a document. It includes two
attributes: src and alt.
src : specifies the file containing the image
alt: specifies text to be displayed when it is
not possible to display the image.
For example:
<h2 id=avionics> Avionics </h2>
The value of a id attribute must be
unique within the document.
To specify the link within same
document href attribute value is
specified by preceding id value with
pound sign (#).
<a href=#avionics> About Avionics
</a>
When we click About Avionics the
browser moves the display to that
Lists
We frequently make and use lists in
daily life- to-do list and grocery lists.
Likewise even a printed document
can be littered with lists.
XHTML provides a simple and
effective ways to specify lists in
documents.
Unordered lists
The <ul> tag, which is a block tag
creates an unordered list. Each item
in a list is specified with an <li>
Definition Lists
These are used to specify lists of terms and
their definitions, as in glossaries.
A definition list is given as the content of a
<dl> tag, which is a block tag. Each item to
be defined in definition list is given as the
content of <dt> tag. The definition
themselves are specified as contents
of<dd> tags.
The defined terms of a definition list are
usually displayed in left margin, the
definitions are usually shown indented on
the line or lines following the term.
Tables
Tables are common fixtures in printed
documents,books and web documents.
These provide a highly effective way of
presenting many kinds of information.
A table is a matrix of cells. The cells in a top
row contains column labels, those in the
leftmost column contain row labels and rest
of the cells contain the data of the table.
The content of a cell can be almost any
document element, including text, heading
horizontal rule, image and nested table.
<tr>
<th colspan=3> Healthy Diet </th>
<tr>
<tr>
<th> Apple</th>
<th>Orange</th>
<th>Banana</th>
</tr>
The rowspan attribute of table heading and table data
tags does for rows what colspan does for columns.
A table that has two levels of column labels and has
row labels must have an empty upper left corner cell
that spans both multiple rows of column labels and
multiple column.
Forms
The most common way for a user to
communicate information from web browser
to server is through a forms.
XHTML provides tags to generate the
commonly used objects on a form. These
are called controls or widgets.
All control tags are inline tags. Most controls
are used to gather information from the
user in form of text or button selection.
The values of all the controls in a form are
called the form data.
The ta
g is used for text, passwords, checkboxes, radio
buttons and action buttons(Reset, Submit and
Plain)
The type attribute of input tag is used to
differentiate between various controls. The name
attribute stores the value of control within form.
The value attribute initializes the value of control.
Text control
It is usually referred as text box, creates a
horizontal text box, into which user can type a line
of text.
Text boxes are often used to gather information
from the user such as user name or address.
Password control
If the contents of a text box should not be
displayed when it is entered by the user
password can be used as type.
Only bullets or asterisks are displayed by the
browser.
<input type=password name=mypassword
size=25 maxlength= 25/>
Labels
Text boxes and most other controls must be
labeled. It can be done by inserting text into
appropriate places in the form.
NAME<input type=text name=Name
size=25/>
Radio buttons
The radio buttons are closely related to
check box buttons, the difference is that only
one radio button can be on at any time.
Everytime a radio button is pressed, the
button in the group that was on is turned off.
The type value is radio, all radio buttons
must have name attribute set in <input>
tag, and all buttons must have same name.
Any one of the button may be checked by
including checked attribute and setting its
value to checked.
Frames
The browser display window can be
used to display more than one
document at a time. The window can
be divided into rectangular areas
each of which is called frames.
Each frame is capable of displaying
its own document. Frames can be
used for number of display
situations.
Among these is having a table of
contents displayed in one frame and
parts of main document displayed in
For example
<frameset rows=200,300,400>
This frameset will have three rows of
frames, since no cols attribute is specified.
Usually browsers have different
capabilities it is more practical to specify
rows with percentages
<frameset rows=22% , 33% , 45%>
<frameset rows=22% , 33% , *>
If two asterisks are given in rows attribute
value, they each get half of what remains
of the height of the window.
A style sheet could specify that fontsize property for <h2> be set to 20
points, which overrides the default
value.
The new value could apply to one
occurrence of an <h2> or all such
occurrences in the document
depending on how the property value
is set.
The idea of style sheets is not new
word processors and desktop
publishing systems used style sheets
to impose particular style on the
style=
property_1:value_1;property_2:value2;
.; property_n:value_n;
Document style specifications appear as
the contents of a style element within
the header of the document, although
the format of the specification is
different from inline style sheets. The
general form is:
<style type=text/css>
Rule_list
</style>
Selector Forms
The selector can have a variety of forms
Simple selector forms:
The simplest selector form is a single
element name , such as h1. In this case
the property values in a rule apply to all
occurrences of the named element.
The selector could be list of element
names, separated by commas, in which
case the property values apply to all
elements of the named elements.
Class Selector
Class selectors are used to allow different
occurrences of the same tag to use different
style specifications.
A style class is defined in a style element by
giving it a name, which is attached to the
tags name with a period.
For example: if we want two paragraph
styles in a document- normal and warningwe define these two classes in the content
of a <style> tag as follows:
p.normal {property-value list}
p.warning {property-value list}
Generic Selectors
Sometimes it is convenient to have a
class of style presentations that
applies to the content of more than
one kind of tag.
This is done by using generic class,
which is defined without a tag name
in its name.
In place of the tag name we use the
generic class, which begin with a
period.
For example:
</p>
Id selectors
An id selector allows the application of a
style to one specific element. The general
form of an id selector is as follows:
#specific-id{property-value list}
The style specified in the id selector applies to
the element with the specific id. For example:
#section14 {font-size:20}
Specifies a font size of 20 to the element
<h2 id=section14> Department of
CSE</h2>
Universal selector
The universal selector, denoted by an
asterisk(*), applies its style to all elements in
the document. For example
*{color:red}
Font properties
The font properties are among the
most commonly used of the stylesheet properties.
Virtually all XHTML documents
include text, which is often used in a
variety of different situations. This
creates a need for text in different
fonts, font styles and sizes.
The font properties allow us to
specify these different forms.
Font Families
The font-family property is used to
specify a list of font names. The
browser will use first font in the list
that it supports.
For example:
font-family:Arial,Helvetica,Futura
The generic font can be specified as
a font- family value. The possible
generic fonts nad examples of each
are shown in table that follows.
Examples
Serif
Sans-serif
MS Arial, Helvetica
Cursive
Fantasy
Critter, Cottonwood
monospace
Courier, Prestige
Color
Color groups
Three levels of collections of colors might
be used by an XHTML document.
The smallest useful set of colors includes
only those that have standard names and
guarenteed to be correctly displayable by
all browsers on all color monitors.
This collection of sixteen colors is called
named colors.
The named colors and hexadecimal codes
for them is shown in table that follows:
Color Properties
The color property is used to specify
the foreground color of XHTML
elements.
Consider the following small table:
Alignment of text
The text-indent property can be used
to specify the indentation
<style type=text/css>
p.indent{text-indent:0.5in}
</style>
.
<p class=indent>
.
</p>