Promoting a paragraph

Thomas Dowling tdowling at ohiolink.edu
Mon Oct 6 16:04:19 EDT 1997


-----Original Message-----
From: Nancy Webb <NWEBB at ogh.on.ca>
To: Multiple recipients of list <web4lib at library.berkeley.edu>
Date: Monday, October 06, 1997 3:12 PM
Subject: Promoting a paragraph


>Hello,
>
>I am fairly new at web design and am able to promote lists
>and such, however, I am trying to design a paragraph with a
>hypertext link on one line, and on the next line a description
>of the hypertext link (indented twice so that it stands out.)  I
>can't seem to do this without leaving a space between the
>1st and 2nd lines.
>
>I have written the following:
>
><A HREF=_________________></A></P>
><UL>
><UL>
>text
></UL>
><BR>
></UL><P>
>
>Does anyone have any suggestions?  Any help would be
>appreciated.
>


I am afraid of sounding like a broken record on this list, but my suggestion
is that you write valid HTML.  The construct you're using here is very
common because it is employed by a very common HTML editor (Netscape
Composer).  However, it violates any recognized HTML DTD--a valid UL can
only only contain one or more LI's--and doesn't even necessarily accomplish
its purpose: there's no rule that a UL will be indented, let alone a
specific amount.  And while this will undoubtedly look right on 90% of the
browsers hitting your page, there's no guarantee that all current and future
browsers will treat UL content not enclosed in an LI the way you expect (or
at all).

What you're describing above is a paragraph with a hanging indent and cannot
be directly created in HTML.  However, if your users are migrating to the
current versions of Netscape or MSIE (or a couple less well known browsers),
try this:

    <HEAD>
    <STYLE TYPE="text/css"><!--
    P.linkdescribed {margin-left: 15%;
        text-indent: -5%}
    /* This creates a class of paragraph indented 15%
        of the document window width, except the first
        line, which is indented 5% less */
    --></STYLE>
    </HEAD>...

    ...<P CLASS="linkdescribed">
    <A HREF="wherever.html">Link</A><BR>
    Your description here</P>


Voila.  A real hanging indent with no need to abuse UL and no extraneous
whitespace between the first and second lines.  This solution will work for
about one third of the browsers that hit the Berkeley Sunsite recently
(http://sunsite.berkeley.edu/cgi-bin/browsercount.pl).  I expect that many
sites will see this figure rise to over half within the next couple of
months.

Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu



More information about the Web4lib mailing list