Which is the proper way?

Discussion in 'HTML' started by paul j, Dec 20, 2004.

  1. paul j

    paul j Guest

    I've heard it said that one should avoid excessive "<br />"'s

    So if I have a list of things what is the proper way to code it:

    <p class="list">Item A</p>
    <p class="list">Item B</p>
    <p class="list">Item C</p>

    OR:

    <p class="list">Item A<br />
    Item B<br />
    Item C<br /></p>
    --
    Up from Third Base to Huntington
    They sang another victory song...........
    paul j, Dec 20, 2004
    #1
    1. Advertising

  2. paul j wrote:
    > I've heard it said that one should avoid excessive "<br />"'s


    True enough.

    > So if I have a list of things what is the proper way to code it:
    >
    > <p class="list">Item A</p>
    > <p class="list">Item B</p>
    > <p class="list">Item C</p>
    >
    > OR:
    >
    > <p class="list">Item A<br />
    > Item B<br />
    > Item C<br /></p>


    You did say "list".

    <ul>
    <li>Item A</li>
    <li>Item B</li>
    <li>Item C</li>
    </ul>

    --
    -bts
    -This space intentionally left blank.
    Beauregard T. Shagnasty, Dec 20, 2004
    #2
    1. Advertising

  3. paul j

    paul j Guest

    On Mon, 20 Dec 2004 15:40:45 -0500, Beauregard T. Shagnasty wrote:

    > paul j wrote:
    >> I've heard it said that one should avoid excessive "<br />"'s

    >
    > True enough.
    >
    >> So if I have a list of things what is the proper way to code it:
    >>
    >> <p class="list">Item A</p>
    >> <p class="list">Item B</p>
    >> <p class="list">Item C</p>
    >>
    >> OR:
    >>
    >> <p class="list">Item A<br />
    >> Item B<br />
    >> Item C<br /></p>

    >
    > You did say "list".
    >
    > <ul>
    > <li>Item A</li>
    > <li>Item B</li>
    > <li>Item C</li>
    > </ul>


    Let's say I don't want it in an ordered or unordered list.
    --
    Up from Third Base to Huntington
    They sang another victory song...........
    paul j, Dec 20, 2004
    #3
  4. paul j

    Steve Pugh Guest

    On Mon, 20 Dec 2004 20:35:27 GMT, paul j <>
    wrote:

    >I've heard it said that one should avoid excessive "<br />"'s
    >
    >So if I have a list of things what is the proper way to code it:
    >
    ><p class="list">Item A</p>
    ><p class="list">Item B</p>
    ><p class="list">Item C</p>
    >
    >OR:
    >
    ><p class="list">Item A<br />
    >Item B<br />
    >Item C<br /></p>


    Neither. If it is a list as your class name suggests then the correct
    markup must be list markup.

    <ul>
    <li>Item A</li>
    <li>Item B</li>
    <li>Item C</li>
    </ul>

    Then use CSS if you want to remove the list markers.

    Steve
    Steve Pugh, Dec 20, 2004
    #4
  5. paul j

    paul j Guest

    On Mon, 20 Dec 2004 20:42:53 +0000, Steve Pugh wrote:

    > On Mon, 20 Dec 2004 20:35:27 GMT, paul j <>
    > wrote:
    >
    >>I've heard it said that one should avoid excessive "<br />"'s
    >>
    >>So if I have a list of things what is the proper way to code it:
    >>
    >><p class="list">Item A</p>
    >><p class="list">Item B</p>
    >><p class="list">Item C</p>
    >>
    >>OR:
    >>
    >><p class="list">Item A<br />
    >>Item B<br />
    >>Item C<br /></p>

    >
    > Neither. If it is a list as your class name suggests then the correct
    > markup must be list markup.
    >
    > <ul>
    > <li>Item A</li>
    > <li>Item B</li>
    > <li>Item C</li>
    > </ul>
    >
    > Then use CSS if you want to remove the list markers.
    >
    > Steve


    I put the word list there, I guess I shouldn't have. What I really have
    there is a class that I use to describe the font used.
    --
    Up from Third Base to Huntington
    They sang another victory song...........
    paul j, Dec 20, 2004
    #5
  6. paul j

    Steve Pugh Guest

    On Mon, 20 Dec 2004 20:41:33 GMT, paul j <>
    wrote:
    >On Mon, 20 Dec 2004 15:40:45 -0500, Beauregard T. Shagnasty wrote:
    >> paul j wrote:
    >>
    >>> So if I have a list of things what is the proper way to code it:
    >>>
    >>> <p class="list">Item A</p>
    >>> <p class="list">Item B</p>
    >>> <p class="list">Item C</p>
    >>>
    >>> OR:
    >>>
    >>> <p class="list">Item A<br />
    >>> Item B<br />
    >>> Item C<br /></p>

    >>
    >> You did say "list".
    >>
    >> <ul>
    >> <li>Item A</li>
    >> <li>Item B</li>
    >> <li>Item C</li>
    >> </ul>

    >
    >Let's say I don't want it in an ordered or unordered list.


    So why did you choose 'list' as a class name? Is it a list or not?

    Steve
    Steve Pugh, Dec 20, 2004
    #6
  7. paul j

    paul j Guest

    On Mon, 20 Dec 2004 20:48:31 +0000, Steve Pugh wrote:

    > On Mon, 20 Dec 2004 20:41:33 GMT, paul j <>
    > wrote:
    >>On Mon, 20 Dec 2004 15:40:45 -0500, Beauregard T. Shagnasty wrote:
    >>> paul j wrote:
    >>>
    >>>> So if I have a list of things what is the proper way to code it:
    >>>>
    >>>> <p class="list">Item A</p>
    >>>> <p class="list">Item B</p>
    >>>> <p class="list">Item C</p>
    >>>>
    >>>> OR:
    >>>>
    >>>> <p class="list">Item A<br />
    >>>> Item B<br />
    >>>> Item C<br /></p>
    >>>
    >>> You did say "list".
    >>>
    >>> <ul>
    >>> <li>Item A</li>
    >>> <li>Item B</li>
    >>> <li>Item C</li>
    >>> </ul>

    >>
    >>Let's say I don't want it in an ordered or unordered list.

    >
    > So why did you choose 'list' as a class name? Is it a list or not?
    >
    > Steve


    I have a class that defines the font there.
    --
    Up from Third Base to Huntington
    They sang another victory song...........
    paul j, Dec 20, 2004
    #7
  8. paul j

    Steve Pugh Guest

    On Mon, 20 Dec 2004 20:48:18 GMT, paul j <>
    wrote:

    >On Mon, 20 Dec 2004 20:42:53 +0000, Steve Pugh wrote:
    >
    >> On Mon, 20 Dec 2004 20:35:27 GMT, paul j <>
    >> wrote:
    >>
    >>>I've heard it said that one should avoid excessive "<br />"'s
    >>>
    >>>So if I have a list of things what is the proper way to code it:
    >>>
    >>><p class="list">Item A</p>
    >>><p class="list">Item B</p>
    >>><p class="list">Item C</p>
    >>>
    >>>OR:
    >>>
    >>><p class="list">Item A<br />
    >>>Item B<br />
    >>>Item C<br /></p>

    >>
    >> Neither. If it is a list as your class name suggests then the correct
    >> markup must be list markup.
    >>
    >> <ul>
    >> <li>Item A</li>
    >> <li>Item B</li>
    >> <li>Item C</li>
    >> </ul>
    >>
    >> Then use CSS if you want to remove the list markers.
    >>

    >I put the word list there, I guess I shouldn't have. What I really have
    >there is a class that I use to describe the font used.


    Class names tend to be more useful if they describe what the element
    is rather than how it's styled. After all one of the benefits of CSS
    is the ease in which the styling can be changed - and it makes no
    sense to wither (a) change all the class values to match the new
    styling or (b) keep the old class name which is no longer accurate.

    Anyway, is your content naturally one paragraph on many paragraphs?
    Answer that and you know which is the correct markup. Unless you show
    us the actual content we can't tell you.

    Steve
    Steve Pugh, Dec 20, 2004
    #8
  9. paul j

    Kris Guest

    In article
    <xsj68b3bld86.dlg@P7Ax8zefAz8re8ranuGa9rebruMUdruPHeYaPrabru9haSE5r56reT
    hufrufRu4p.org>,
    paul j <> wrote:

    > > You did say "list".
    > >
    > > <ul>
    > > <li>Item A</li>
    > > <li>Item B</li>
    > > <li>Item C</li>
    > > </ul>

    >
    > Let's say I don't want it in an ordered or unordered list.


    Then use CSS to make the bullet/number dissapear.

    ul, li {
    margin-left: 0; padding-left: 0; list-style-type: none;
    }

    Whatever you want to make it look like, if it is a list, then it is a
    list.

    --
    Kris
    <> (nl)
    Kris, Dec 20, 2004
    #9
  10. paul j

    Uncle Pirate Guest

    paul j wrote:

    > On Mon, 20 Dec 2004 15:40:45 -0500, Beauregard T. Shagnasty wrote:
    >
    >
    >>paul j wrote:
    >>
    >>>I've heard it said that one should avoid excessive "<br />"'s

    >>
    >>True enough.
    >>
    >>
    >>>So if I have a list of things what is the proper way to code it:
    >>>
    >>><p class="list">Item A</p>
    >>><p class="list">Item B</p>
    >>><p class="list">Item C</p>
    >>>
    >>>OR:
    >>>
    >>><p class="list">Item A<br />
    >>>Item B<br />
    >>>Item C<br /></p>

    >>
    >>You did say "list".
    >>
    >><ul>
    >><li>Item A</li>
    >><li>Item B</li>
    >><li>Item C</li>
    >></ul>

    >
    >
    > Let's say I don't want it in an ordered or unordered list.


    You mean it's not a list? If it is a list, why would you not want to
    code it as a list? If it's just those pesky numbers or dots next to it,
    they are easily removed using CSS.

    --
    Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
    Webmaster/Computer Center Manager, NMSU at Alamogordo
    Cooordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
    '94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
    A zest for living must include a willingness to die. - R.A. Heinlein
    Uncle Pirate, Dec 20, 2004
    #10
  11. paul j

    Neal Guest

    On Mon, 20 Dec 2004 20:48:18 GMT, paul j <>
    wrote:

    >>> So if I have a list of things what is the proper way to code it:
    >>>
    >>> <p class="list">Item A</p>
    >>> <p class="list">Item B</p>
    >>> <p class="list">Item C</p>


    As suggested, use list markup for lists.

    > I put the word list there, I guess I shouldn't have. What I really have
    > there is a class that I use to describe the font used.


    Class and ID names should describe the content, not the style. Now if the
    purpose of the item is to demonstrate a font, then I suppose the name of
    the font would be appropriate.

    But this leads to a new problem - what if the font is not on the user's
    computer? If the user does not have the font installed which you are
    referring to, you're sunk. The browser's default font will be used
    instead. In this case an image of the text may be necessary.

    For more discussion of the font issue and a great example of how to handle
    discussion of fonts when the user may not have the font installed, see
    <http://www.xs4all.nl/~sbpoley/webmatters/verdana.html>.
    Neal, Dec 20, 2004
    #11
  12. paul j

    Neal Guest

    paul j wrote:

    > Let's say I don't want it in an ordered or unordered list.


    There are two points here.

    1) In HTML without considering CSS, we don't even concern ourselves with
    rendering. That's inconsequential. If it's a list, it falls into one of
    three categories: a list which is inherently ordered <ol>, a list with no
    inherent order <ul>, and a list containing terms and definitions <dl>.

    Pick which one most closely describes your content. Ingredients to a cake
    are not inherently ordered, so we'd use <ul>. The reipe instructions,
    however, are inherently ordered, so <ol> is correct. And if you need to
    define a list of terms used in the recipe, <dl> can come in handy.

    2) Using CSS we can style this list to look like damn near anything at
    all. We can remove any bullets or numbering, we can add a custom bulet, we
    can make it go left-to-right rather than top-to-bottom. We can even
    display it to read like a paragraph in many more-compliant-than-IE
    browsers.
    Neal, Dec 20, 2004
    #12
  13. paul j

    paul j Guest

    On Mon, 20 Dec 2004 20:56:56 +0000, Steve Pugh wrote:

    > On Mon, 20 Dec 2004 20:48:18 GMT, paul j <>
    > wrote:
    >
    >>On Mon, 20 Dec 2004 20:42:53 +0000, Steve Pugh wrote:
    >>
    >>> On Mon, 20 Dec 2004 20:35:27 GMT, paul j <>
    >>> wrote:
    >>>
    >>>>I've heard it said that one should avoid excessive "<br />"'s
    >>>>
    >>>>So if I have a list of things what is the proper way to code it:
    >>>>
    >>>><p class="list">Item A</p>
    >>>><p class="list">Item B</p>
    >>>><p class="list">Item C</p>
    >>>>
    >>>>OR:
    >>>>
    >>>><p class="list">Item A<br />
    >>>>Item B<br />
    >>>>Item C<br /></p>
    >>>
    >>> Neither. If it is a list as your class name suggests then the correct
    >>> markup must be list markup.
    >>>
    >>> <ul>
    >>> <li>Item A</li>
    >>> <li>Item B</li>
    >>> <li>Item C</li>
    >>> </ul>
    >>>
    >>> Then use CSS if you want to remove the list markers.
    >>>

    >>I put the word list there, I guess I shouldn't have. What I really have
    >>there is a class that I use to describe the font used.

    >
    > Class names tend to be more useful if they describe what the element
    > is rather than how it's styled. After all one of the benefits of CSS
    > is the ease in which the styling can be changed - and it makes no
    > sense to wither (a) change all the class values to match the new
    > styling or (b) keep the old class name which is no longer accurate.
    >
    > Anyway, is your content naturally one paragraph on many paragraphs?
    > Answer that and you know which is the correct markup. Unless you show
    > us the actual content we can't tell you.
    >
    > Steve


    What I'm dealing with is a list of links down a left side column.

    I was using:

    <p class="linkfont">
    <a href="http://www.google.com">Google</a><br />
    <a href="http://www.espn.com">ESPN</a><br />
    <a href="http://www.yahoo.com">Yahoo</a>
    </p>

    You're suggesting:

    <ul class="linkfont">
    <li><a href="http://www.google.com">Google</a></li>
    <li><a href="http://www.espn.com">ESPN</a></li>
    <li><a href="http://www.yahoo.com">Yahoo</a></li>
    </ul>

    And then add another css definition for how I like <UL>s to appear? Or can
    I include the font style in the definition for the unordered list?
    --
    Up from Third Base to Huntington
    They sang another victory song...........
    paul j, Dec 20, 2004
    #13
  14. paul j

    Kris Guest

    In article
    <gt8mmyyp6gy0.dlg@P7Ax8zefAz8re8ranuGa9rebruMUdruPHeYaPrabru9haSE5r56reT
    hufrufRu4p.org>,
    paul j <> wrote:

    > And then add another css definition for how I like <UL>s to appear? Or can
    > I include the font style in the definition for the unordered list?


    Maybe this will help, http://www.alistapart.com/articles/taminglists/

    --
    Kris
    <> (nl)
    Kris, Dec 20, 2004
    #14
  15. paul j

    Steve Pugh Guest

    On Mon, 20 Dec 2004 21:13:26 GMT, paul j <>
    wrote:
    >On Mon, 20 Dec 2004 20:56:56 +0000, Steve Pugh wrote:
    >> On Mon, 20 Dec 2004 20:48:18 GMT, paul j <>
    >> wrote:
    >>>On Mon, 20 Dec 2004 20:42:53 +0000, Steve Pugh wrote:
    >>>>
    >>>> Neither. If it is a list as your class name suggests then the correct
    >>>> markup must be list markup.
    >>>>
    >>>> Then use CSS if you want to remove the list markers.
    >>>>
    >>>I put the word list there, I guess I shouldn't have. What I really have
    >>>there is a class that I use to describe the font used.

    >>
    >> Class names tend to be more useful if they describe what the element
    >> is rather than how it's styled. After all one of the benefits of CSS
    >> is the ease in which the styling can be changed - and it makes no
    >> sense to wither (a) change all the class values to match the new
    >> styling or (b) keep the old class name which is no longer accurate.
    >>
    >> Anyway, is your content naturally one paragraph on many paragraphs?
    >> Answer that and you know which is the correct markup. Unless you show
    >> us the actual content we can't tell you.

    >
    >What I'm dealing with is a list of links down a left side column.


    So it is a list now? Make your mind up.

    >I was using:
    >
    ><p class="linkfont">
    ><a href="http://www.google.com">Google</a><br />
    ><a href="http://www.espn.com">ESPN</a><br />
    ><a href="http://www.yahoo.com">Yahoo</a>
    ></p>
    >
    >You're suggesting:
    >
    ><ul class="linkfont">
    ><li><a href="http://www.google.com">Google</a></li>
    ><li><a href="http://www.espn.com">ESPN</a></li>
    ><li><a href="http://www.yahoo.com">Yahoo</a></li>
    ></ul>


    Yep.

    >And then add another css definition for how I like <UL>s to appear?
    >Or can I include the font style in the definition for the unordered list?


    Of course you can. There's no limits on the number of properties that
    can b defined together.

    Steve
    Steve Pugh, Dec 20, 2004
    #15
  16. paul j wrote:

    > What I'm dealing with is a list of links down a left side column.


    Aha. So it *is* a list.

    > I was using:
    >
    > <p class="linkfont">
    > <a href="http://www.google.com">Google</a><br />
    > <a href="http://www.espn.com">ESPN</a><br />
    > <a href="http://www.yahoo.com">Yahoo</a>
    > </p>


    No.

    > You're suggesting:
    >
    > <ul class="linkfont">
    > <li><a href="http://www.google.com">Google</a></li>
    > <li><a href="http://www.espn.com">ESPN</a></li>
    > <li><a href="http://www.yahoo.com">Yahoo</a></li>
    > </ul>


    Yes! Except, name it class="urls" or similar.

    ..urls {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 105%;
    list-style-type: none;
    ...any other styles you want here
    }

    Oh, don't forget closing slashes: http://www.google.com/

    > And then add another css definition for how I like <UL>s to appear? Or can
    > I include the font style in the definition for the unordered list?


    Please see:
    http://www.w3schools.com/css/default.asp
    http://htmldog.com/guides/cssbeginner/

    --
    -bts
    -This space intentionally left blank.
    Beauregard T. Shagnasty, Dec 20, 2004
    #16
  17. RE/
    >Class and ID names should describe the content, not the style.


    Seems to me like nobody's answering the OP's root question:

    Is it better to have five separate paragraphs, each with it's own 'class='
    statement, or is it preferable to have a single paragraph/class statement and
    four <br/> commands.

    Or am I misunderstanding the question?
    --
    PeteCresswell
    (Pete Cresswell), Dec 21, 2004
    #17
  18. paul j

    Oli Filth Guest

    (Pete Cresswell) wrote:
    > RE/
    >
    >>Class and ID names should describe the content, not the style.

    >
    >
    > Seems to me like nobody's answering the OP's root question:
    >
    > Is it better to have five separate paragraphs, each with it's own 'class='
    > statement, or is it preferable to have a single paragraph/class statement and
    > four <br/> commands.
    >
    > Or am I misunderstanding the question?


    I think the general consensus (with which I agree) is that neither
    separate paragraphs nor a paragraph with breaks is a good semantic
    description of what the OP requires.

    An unordered list is appropriate (for that is exactly what the OP is
    trying to construct), and that's what most people in this thread have
    suggested.

    Oli
    Oli Filth, Dec 21, 2004
    #18
  19. (Pete Cresswell) wrote:
    > RE/


    Please use the poster's name, instead of "RE". Thanks. You can set
    your newsreader to do this for you.

    >> Class and ID names should describe the content, not the style.

    >
    > Seems to me like nobody's answering the OP's root question:


    I believe it has been answered.

    > Is it better to have five separate paragraphs, each with it's own
    > 'class=' statement, or is it preferable to have a single
    > paragraph/class statement and four <br/> commands.


    A "list" was described, therefore the correct markup would be the
    previously mentioned <ul><li>. His sample (several URLs that he in
    fact called a "list) was not a paragraph.

    > Or am I misunderstanding the question?


    ;-)

    --
    -bts
    -This space intentionally left blank.
    Beauregard T. Shagnasty, Dec 21, 2004
    #19
  20. paul j

    Neal Guest

    Pete Cresswell wrote:

    > RE/
    >> Class and ID names should describe the content, not the style.


    I said this, NOT some "RE/". Please attribute.
    Neal, Dec 21, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve C. Orr, MCSD

    Re: What is a proper way to set up smtp

    Steve C. Orr, MCSD, Jul 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    358
    jaekim
    Jul 3, 2003
  2. Brandon Potter

    Proper Way to work with SQL Connections

    Brandon Potter, Jan 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    352
    Kevin Spencer
    Jan 23, 2004
  3. David McCallum

    Which is proper/correct

    David McCallum, Jan 12, 2004, in forum: Java
    Replies:
    6
    Views:
    357
  4. xyZed
    Replies:
    3
    Views:
    1,348
    Jacqui or (maybe) Pete
    Jun 29, 2003
  5. Eric Lilja
    Replies:
    5
    Views:
    719
    Eric Lilja
    Mar 4, 2005
Loading...

Share This Page