| Lines and Dividers |
|
|
Text Functions
|
Course Contents
|
| Horizontal Rules | Paragraphs | Text Columns | Text Breaks |
<hr> command draws a single line across the
HTML page at the point of insertion. Note that the command is self-contained and
requires no closing argument. The command has four optional parameters that govern
its appearance and placement on the page:
align=leftright or
center
these parameters align the horizontal rule on the page. Horizontal rules placed in tables, lists, forms and other specially formatted areas will conform to the formatting of the sections in which they are placed.
Examples:
<hr align=left width=50%>
<hr align=right width=50%>
width=n%n
where n% is a percent of the total maximum
pagewidth. The default is 100%.
or where
n is expressed in actual pixels.
At a screen resolution of 640 X 480 the approximate width of the screen in most
browsers is 600 pixels.
Examples:
<hr align=center width=300>
<hr align=center width=25%>
size=n
where n is the height (most people would think of
it as the width) of the horizontal rule in pixels.
The default is only one pixel. Sizes greater than 1 pixel produce an embossed
effect unless the noshade parameter
is used (compare with below).
Examples:
<hr size=2>
<hr size=10>
noshade
produces a rounded solid (possibly shaded!) rather than rectangular embossed horizontal rule (compare with above).
Examples:
<hr size=10 noshade>
|
The basic form of the paragraph command is very simple:
This command forces a line break at the point of insertion in the HTML code and begins a
new paragraph below with one intervening line of space. No closing command
Example:
This is paragraph one.<p>This is paragraph two. yields - This is paragraph one. This is paragraph two.
Note that the browser removes all extraneous spaces when formatting text
and reduces them to a single space. This includes extra spaces at the ends of
sentences after the period and extra spaces after colons. This can reduce text
readability. The solution is always to include a non-breaking space character
(
Paragraph Alignment
Paragraphs can be aligned using the
Examples:
yields -
This paragraph is aligned to the right. and so on -
This paragraph is aligned to the center. This paragraph is aligned to the left.
Note that the default
is to align all paragraphs to the
The Internet Explorer browser uses the
A Netscape extension to HTML allows the creation of text columns. The basic form of the command is shown below:
Where
This command can produce very odd results in other browsers and is not compatible with some
table elements and list elements. In general, it is better to produce this effect with
tables. See an example of the use of the
Note that the column breaks will not display in Internet Explorer. Explorer requires the use of multi-celled tables to accomplish the similar effects.
HTML provides several ways in which to govern the way in which text is placed on the page. The table below provides a synopsis of text break commands:
TOP |
Horizontal Rules
|
Paragraphs
|
Text Columns
|
Text Breaks
|
You are here: NetStrider » Tutorials » HTML » LINES/DIVIDERS « |