CHAPTER 3 - HTML-FORMATTING
CHAPTER 3 - HTML-FORMATTING
OBJECTIVES:
Now that you can make chunk of text appear as headings, appear as paragraphs or get enumerated as
lists, it’s now time to move on to providing them with styles and effects.
Remember that your Web site either provides entertainment and/or information; thus enticing your viewers
is one main concern therefore supplying your content with design is a major boost. But do not exaggerate
in doing so. Remember that there is always beauty in simplicity.
❖ Typography – appearance and arrangement of the characters that make up your text.
❖ Typeface – the actual appearance, examples are Times New Roman, Arial, etc.
❖ Type style – this is the variations given to the text such as boldface, italic, regular, etc.
❖ Font – combination of typeface and type style.
You can specify the text font using the face attribute <face=”value”>. Although you can use any font, it is
recommended to use a more readable font such as Arial or any sans-serif characters with straight lines and
requires less resolution. You should also keep in mind not to use too many different fonts in your Web page.
Preformatting Text
<pre>
</pre>
The container tag <font></font> is used to alter the typeface, size and color of text.
If the typeface is not set, the text will be displayed in the default typeface set on the Web browser used to
display.
If you use a word processor, you must be familiar with the ability to make text bold, italicized, or underlined;
these are just three of the ten options available to indicate how text can appear in HTML and XHTML.
Bold Text
Anything that appears within <b>...</b> element, is displayed in bold as shown below:
Italic Text
Anything that appears within <i>...</i> element is displayed in italicized as shown below:
Underlined Text
Anything that appears within <u>...</u> element, is displayed with underline as shown below:
Strike Text
Anything that appears within <strike>...</strike> element is displayed with strikethrough, which is a thin line
through the text as shown below:
Monospaced Font
The content of a <tt>...</tt> element is written in monospaced font. Most of the fonts are known as variable-
width fonts because different letters are of different widths (for example, the letter 'm' is wider than the letter
'i'). In a monospaced font, however, each letter has the same width.
Superscript Text
The content of a <sup>...</sup> element is written in superscript; the font size used is the same size as the
characters surrounding it but is displayed half a character's height above the other characters.
The content of a <sub>...</sub> element is written in subscript; the font size used is the same as the
characters surrounding it, but is displayed half a character's height beneath the other characters.
Inserted Text
Deleted Text
Larger Text
The content of the <big>...</big> element is displayed one font size larger than the rest of the text
surrounding it as shown below:
Smaller Text
The content of the <small>...</small> element is displayed one font size smaller than the rest of the text
surrounding it as shown below:
Grouping Content
The <div> and <span> elements allow you to group together several elements to create sections or
subsections of a page.
For example, you might want to put all of the footnotes on a page within a <div> element to indicate that all
of the elements within that <div> element relate to the footnotes. You might then attach a style to this <div>
element so that they appear using a special set of style rules.
Images or Graphics
You can add image to your Web page with the use of <img> tag. The <img> tag supports several attributes,
but the scr= attribute is the one that specifies the name and location of the image.
You can create an image from Adobe Photoshop, MS Paint or any image-editing programs. You should
save your image in a JPEG format and compress the image so that loading time will be fast. You can reduce
image size by saving your file for the web. You can also use GIF format for logos and other images that
include text and graphics.
Attribute Table for <img>
alt Indicates the alternative text or the text that appears when the <img
src=”picture.jpeg”
mouse hovers over the image and/or when the image can not alt=”Can not
display”>
be displayed.image to be inserted.
name Assigns a name to the image. <img
src=”picture.jpeg”
name=”picture.jpeg”>
border Indicates the width of the border around the image in pixels. <img
src=”picture.jpeg”
height Indicates the height of the image in pixels. If not the actual <img
src=”picture.jpeg”
width Indicates the width of the image in pixels. If not the actual <img
src=”picture.jpeg”
vspace Sets the vertical space in pixels above and below the image. <img
src=”picture.jpeg”
vspace=”6”>
hspace Sets the horizontal space in pixels beside the image. <img
src=”picture.jpeg” hspace=”6”>
lowsrc Indicates the image to be loaded before the actual image <img src=”picture.bmp”
here.
HTML supports various image formats or file type namely:
❖ Joint Photographic Experts Group or JPEG (or JPG) – Supports a million of colors and has the file
name extension of either jpeg or jpg. This file format is commonly used.
❖ Compuserve Graphics Interchange Format or GIF – Supports up to 256 colors and has the file
name extension of gif. This file format is commonly used and can be animated.
❖ Portable Network Graphics or PNG – Supports a million of colors and has the file name extension
of png.
❖ Bitmap or BMP – Supports a million of colors and has the file name extension of bmp. This type of
image is not compressed that’s why it provides the best quality for image at the cost of file size.
Page|8
Before you can use graphic as hyperlink you have to create the image first in
Photoshop, Paint or other programs.
Page|9
Video Links:
https://www.youtube.com/watch?v=zc0b3Vrconk
https://www.youtube.com/watch?v=4ZunanytE88
https://www.youtube.com/watch?v=3YVfF3P0hOc
References:
https://www.w3schools.com/html/html_colors.asp
https://www.w3schools.com/html/html_links.asp
https://www.w3schools.com/html/html_images.asp
https://www.w3schools.com/html/html_symbols.asp
https://www.w3schools.com/html/html_emojis.asp