BASIC TAGS: Formatting & Hyperlinks
Basic Parts of the HTML Document
All HTML documents begin with an
tag and close with a tag.
The portion of the document
sets off information that isn't displayed on the Web page
itself but establishes information about the page or
sends information to the server.
The establishes the
visible portion of the document.
Basic header Tags
The tags put the
name of the document in the title bar. You want to be
sure your that you use a meaningful name as this will
be the title of the page if it is bookmarked.
Basic text Formatting
Text can be formatted in a variety of ways. It can be made strong, or emphasized.
You can also use strike-through and teletype.
Text can be formatted in a variety of ways. It can be made strong, or emphasized.
You can also use strike-through and teletype.
The PRE tag allows you to create pre-formatted text. For example:
Basic line Breaks
text can be broken in a variety of ways. We can use both line and Paragraph Breaks to force text to end and begin on a new line.
line Breaks
This is a line. We insert a
and our text begins on a new line.
Paragraph Breaks
This is a line. We insert a
and our text skips a line and begins on a new line. Wee close the paragraph break with a
As well, the paragraph tag can contain an "align" attribute which controls the alignment of the proceeding text.
For example:
This is a paragraph break that forces our text to be aligned to the left.
This is a paragraph break that forces our text to be aligned to the center.
This is a paragraph break that forces our text to be aligned to the right.
The above text looks like this:
This is a paragraph break that forces our text to be aligned to the left.
This is a paragraph break that forces our text to be aligned to the center.
This is a paragraph break that forces our text to be aligned to the right.
This basically replaces the older tag.
heading Tags
There are 6 basic "headings".
heading 1
heading 2
heading 3
heading 4
heading 5
heading 6
These can also include alignment attributes. For example:
heading 1 with a right alignment
heading 2 with a justified alignment
The above text looks like this:
heading 1
heading 2
heading 3
heading 4
heading 5
heading 6
These can also include alignment attributes. For example:
heading 1 with a right alignment
heading 2 with a justified alignment
Hyperlinks
You can create a standard hyper link through an a href="url" tag. The link can be to another site (i.e. cnn.com) or to another page relatively located within your site (i.e. Back to Main Menu.)
For example:
To cnn.com
Back to the class menu
Back to my Main Course Syllabus Listing
You can also link to a target location within a document. For instance, we can go to the top of the page.
This is done as follows:
The tag creates the target
The links to that target
from elsewhere in the document.
You can also launch a new window through the use of the target="_new" tag. This will launch many new windows. If you always want the the new window to launch within the same new window you can use a name within the target tag.
Go to Facebook in a New Window
Got to Facebook in a Window I have named
Go to Facebook in the same Window I have named
For Example:
New Window
My Window
Colors are typically referred to by their hexcodes, or their hexidemical equivelents to their RGB values. For example: "#FFFFFF" = "white", while "#000000" = "black".
WORKING WITH IMAGES
Images are typically stored as Compuserve GIF (.gif) files, JPEG (.jpeg or jpg) files, or PNG (.png) files.
GIF Files
GIF is a common format for in-line images, and browsers have supported it for years. The GIF format is 8 bit or lower, and is most suitable for
line art or other illustrations. The GIF format is "lossless." The compression algorithym used by the GIF formatlooks for pixels in the same row of the same color value. Because of this, GIF files will be smaller if the graphic used contains horizontal bands ofthe same color.
When exporting in Photoshop you can generate or constrain palettes to:
- Web
Uses the 216-color palette that Web browsers, regardless of platform, use to display images on a monitor limited to 256 colors. This palette is a subset of the Mac OS 8-bit palette. Use this option to avoid browser dither when viewing images on a monitor display limited to 256 colors.
- Perceptual
Creates a custom palette by giving priority to colors for which the human eye has greater sensitivity.
- Selective
Creates a color table similar to the Perceptual color table, but favoring broad areas of color and the preservation of Web colors. This option usually produces images with the greatest color integrity.
- Adaptive
Creates a palette by sampling the colors from the spectrum appearing most commonly in the image. For example, an RGB image with only the colors green and blue produces a palette made primarily of greens and blues. Most images concentrate colors in particular areas of the spectrum. To control a palette more precisely, first select a part of the image containing the colors you want to emphasize. Photoshop weights the conversion toward these colors.
An interlaced GIF (gif87a) is a graphic file which displays as it downloads
because the data has been encoded in multiple passes. First it appears
blocky, and gradually refines in quality as data continues continues downloading to the browser.
JPEG Files
The JPEG format uses either 16 or 32 bit color, and is most suitable for displaying photographic images. JPEG files can be saved
in several levels of quality, with files saved as "low quality" having the
smallest size, and files saved as "maximum quality" not yielding much
savings at all.
A JPEG file saved in the "progressive" format is encoded with multiple passes so that the JPEG appears quickly in a blocky form, and gradual quality as the data
continues to download. It works a lot like an interlaced GIF.
PNG Files
PNG stands for "Portable Network Graphic" and it is a more recent image
format. It is a lossless compression algorithym (same as GIF) in which files can be saved at a
variety of bit depths, and it has a 10-30% better compression
than GIF. For highest quality images, the fact that it is a lossless
algorithm means that it offers superior quality to JPEG.
IMG Tag
Images embedded in the page using the "img" tag.
Typical syntax would be
Its a good idea to enter the height and width specifications of the image within the img src tag,as well as including an ALT description for people with non-graphical and screenreaders browsers.
Image Transparency
Portions of gif images can be made transparent.
Image as links, borders, and alt tags
Images can be used as links. You can simply use an [a href="link.htm"] tag prior to the img tag. However, you will notice that the image will have a border around it. You can modify the border by using the border tag within the img src tag.
i.e.
Align Tags
You can align text around images by including the align tag within the img tag. I.e.
Here we we typed
indicating that the image should be flushed to the left and the text to the right.
Here we we typed
indicating that the image should be flushed to the right and the text to the left.
If you're having trouble aligning images and text, you will want to tell the browser to "keep breaking" until the margin is clear of obstacles such as the image. See below:
Lists
Ordered Lists
- wake up
- brush teeth
- shower
- make breakfast
- wake up
- brush teeth
- shower
- make breakfast
- wake up
- brush teeth
- shower
- make breakfast
- wake up
- brush teeth
- shower
- make breakfast
Unordered Lists