<A> and <IMG> -- <P></P> required?

2 views
Skip to first unread message

Richard Akerman

unread,
Sep 9, 1995, 3:00:00 AM9/9/95
to
Is it good HTML to have

<BODY>

<A HREF="./">
<IMG SRC="images/left.gif" ALT="[ <- ]" ALIGN=MIDDLE>
Back to my Home Page</A>

</BODY>

or do Anchors and/or IMGes need to be in a Paragraph <P>container</P>?

--
Richard J. Akerman | "Less insane than anticipated."
ac...@ccn.cs.dal.ca |
http://www.ccn.cs.dal.ca/~ac010/ |


Alan J Flavell

unread,
Sep 10, 1995, 3:00:00 AM9/10/95
to
In article <DEn60...@cs.dal.ca>

ac...@ccn.cs.dal.ca (Richard Akerman) writes:

><A HREF="./">
> <IMG SRC="images/left.gif" ALT="[ <- ]" ALIGN=MIDDLE>
> Back to my Home Page</A>

>or do Anchors and/or IMGes need to be in a Paragraph <P>container</P>?

_Strictly_, everything needs to be in a container, AFAIK.
There are programs that validate your HTML. Details are posted here
frequently. If you want to know the _strict_ rules, run a formal
validator against your test case. Even the experts occasionally give
wrong answers on usenet, and I'm no SGML / HTML expert.

Does anyone write _strict_ html, other than as the formal output
of some processor? ;-}

However , allow me to make two points on the side about your HTML.

Putting angle brackets into an ALT text is a fraught activity.
Some browsers will parse the angle brackets as HTML delimiters.
On the other hand, if you try to circumvent that by coding them
as &lt; and &gt; (which is perfectly correct HTML), some browsers
will fail to render those entities. So you can't win. This is
one of those irritating situations where "writing correct HTML"
does not solve the problem. Hassle those browser writers to fix
the bugs.

My second point is your use of the word "Back". That always
annoys me: you have no idea whether I have ever previously
visited your home page, so it makes no sense to invite me to
go "back" to it. Anyway, the browser has a "Back" function:
naive users get confused by re-use of this word to mean something
different. (In my experience... I know some people disagree).

Suggestions:

"To my home page"
"My home page"
"Visit my home page"

Trust your readers to recognize a link when they see one, and to
know what to do with it. Don't be tempted to put "Click here", ok?

Brad Chase

unread,
Sep 12, 1995, 3:00:00 AM9/12/95
to
ac...@ccn.cs.dal.ca (Richard Akerman) wrote:

>Is it good HTML to have

><BODY>

><A HREF="./">


> <IMG SRC="images/left.gif" ALT="[ <- ]" ALIGN=MIDDLE>
> Back to my Home Page</A>

></BODY>

>or do Anchors and/or IMGes need to be in a Paragraph <P>container</P>?

Anchors and images are of the text context type, which is properly
contained by headings, paragraphs, list headers, definition terms,
captions, credits, pre-formatted text, and addresses. Most browsers
won't care, however. Encapulating the anchor within a paragraph (or
header) does allow you to specify the justification of the text.

Brad Chase

Brad...@scoot.netis.com


Reply all
Reply to author
Forward
0 new messages