Page 59 - DCAP202_Fundamentals of Web Programming
P. 59
Fundamentals of Web Programming
Notes Of course in <a> tags you should put yours links. And you can add as many links as you want.
The <div> tag defines a division or a section in an HTML document.
Did u know? In div element overflow property is set to auto which mean that if the content
is clipped, the browser should display a scroll-bar to see the rest of the content.
5.3.5 Inserting Inline Images
<Img> causes an “inline image” to be inserted into the output. The image will be retrieved and
rendered as if it were just another part of the text. Inline images can occur within headings, or
paragraphs, almost anywhere in fact, except body (in other words, you can have a ‘free floating’
<img> tag—it must be contained within some other element.)
Like <hr>, this is an empty element. That is, there must be no end-tag. You will sometimes see
<hr> used with an end-tag (e.g as a container around a caption), but this is obsolete usage.
<Img> has 1 required attributes src as well as 3 optional attributes.
src
The src attribute is used to specify the URL of the image (i.e. the address or filename the browser
uses to retrieve the image file), e.g.
<img src=”http://planet-earth.bogus.us/icons/secret.pictures.gif”>
<img src=”grandchild.gif”>
alt
alt is used to provide an text alternative to the image for readers whose browsers do not support
graphics (or for visually impaired readers using alternative display devices). Although not
required, the use of the alt attribute is nearly always appropriate and is strongly recommended.
The only exception might be cases where the image is strictly decorative or of generic character.
In this case the default text chosen by the browser (typically something like “[IMAGE]” may be
adequate.
align
align can take one of three values:
top
middle
bottom
and is used to indicate how the browser should align the image with the adjacent text.
bottom: align the bottom of the image with the bottom of text
middle: align the middle of the image with the middle of text
top: align the top of the image with the top of text.
Images can also be retrieved using by means of a hypertext link using the <a> tag. The key
difference between an inline image and an image retrieved with the <a> tag is that an inline
image requires no action on the part of the reader; it is retrieved with the page just as if it were
part of the text. With the <a> tag, the reader has to make a special action (e.g. clicking on a
button) to retrieve the image.
52 LOVELY PROFESSIONAL UNIVERSITY