Best syntax for bold <li> "Headings"

Discussion in 'HTML' started by Andrew, Jan 26, 2007.

  1. Andrew

    Andrew Guest

    Hi,

    Can I have some suggestions for the most syntactically correct way to
    make a bold heading within a list item? The page I am working on is:

    http://people.aapt.net.au/~adjlstrong/homer.html

    I have used the following but I have a few qualms:
    <ul>
    <li><strong>heading</strong>list info</li>
    </ul>

    BTW making this page has been the only time I have missed Dreamweaver:
    doing long nested lists by hand is a little soul-destroying :)

    Thanks for any advice!

    Andrew

    --
    The STRONG Family Web Site
    http://www.strong-family.org
    Andrew, Jan 26, 2007
    #1
    1. Advertising

  2. Andrew wrote:
    > Hi,
    >
    > Can I have some suggestions for the most syntactically correct way to
    > make a bold heading within a list item? The page I am working on is:
    >
    > http://people.aapt.net.au/~adjlstrong/homer.html
    >
    > I have used the following but I have a few qualms:
    ><ul>
    ><li><strong>heading</strong>list info</li>
    ></ul>


    I'll listen in; I do it the same way you do.

    Intersting page. I did some courses on ancient Greece in college, and
    recently read a couple of books on ancient Greece (and Egypt and Rome)
    as a refresher. Thanks for the link. :)

    OT: So where did the Achilles/Patroclus perhaps-legend come from, and
    why is that the only point you claim without support?
    if you want to go email.

    Your "Converting to Linux" (which I use) link is borked.


    --
    Blinky RLU 297263
    Killing all posts from Google Groups
    The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
    Blinky the Shark, Jan 26, 2007
    #2
    1. Advertising

  3. Andrew

    K A Nuttall Guest

    Andrew wrote:

    > Can I have some suggestions for the most syntactically correct
    > way to make a bold heading within a list item?


    I use a heading tag, outside the list. I assumed this was the
    semantically correct way to do it, even though it makes the styling a
    bit awkward.


    --
    K A Nuttall
    www.yammer.co.uk
    Re-type the e-mail address how it sounds, remove .invalid
    K A Nuttall, Jan 26, 2007
    #3
  4. Andrew

    Neredbojias Guest

    On Fri, 26 Jan 2007 08:13:24 GMT Blinky the Shark scribed:

    > OT: So where did the Achilles/Patroclus perhaps-legend come from, and
    > why is that the only point you claim without support?


    When whomever it was got shot in the foot, he yelled out, "Achy heel! Achy
    heel!" and they nicknamed him accordingly...

    --
    Neredbojias
    He who laughs last sounds like an idiot.
    Neredbojias, Jan 26, 2007
    #4
  5. Andrew

    Andrew Guest

    On Fri, 26 Jan 2007 08:13:24 +0000, Blinky the Shark wrote:

    > Andrew wrote:
    >> Hi,
    >>
    >> Can I have some suggestions for the most syntactically correct way to
    >> make a bold heading within a list item? The page I am working on is:
    >>
    >> http://people.aapt.net.au/~adjlstrong/homer.html
    >>
    >> I have used the following but I have a few qualms:
    >><ul>
    >><li><strong>heading</strong>list info</li>
    >></ul>

    >
    > I'll listen in; I do it the same way you do.


    Seems to be the general consensus, from another reply here and a general
    search via Google.

    >
    > Intersting page. I did some courses on ancient Greece in college, and
    > recently read a couple of books on ancient Greece (and Egypt and Rome)
    > as a refresher. Thanks for the link. :)
    >
    > OT: So where did the Achilles/Patroclus perhaps-legend come from, and
    > why is that the only point you claim without support?
    > if you want to go email.


    Achilles / Patroclus I have not yet filled in. I aim to speak a little
    about Achilles / Patroclus + Gilgamesh / Enkidu + Frodo / Sam.

    >
    > Your "Converting to Linux" (which I use) link is borked.


    Still underway. This small site is a tearing down and rebuild of an older
    site so it a little messy; hence the free web space, no domain name etc.
    I will be writing about Xubuntu 6.10 Edgy Eft

    Thanks for your trouble!

    Andrew

    --
    The STRONG Family Web Site
    http://www.strong-family.org
    Andrew, Jan 26, 2007
    #5
  6. Andrew

    Andy Dingley Guest

    On 26 Jan, 08:21, K A Nuttall <> wrote:
    > Andrew wrote:
    > > Can I have some suggestions for the most syntactically correct
    > > way to make a bold heading within a list item?


    > I use a heading tag, outside the list.


    Hard to say, without seeing the code, but doesn't this mean that you've
    marked up the whole list (many elements) as _one_ heading?

    Is a list element a "heading" anyway? Headings "head" something, they
    mark the location of the content itself. A list (such as a chapter
    list) isn't a list of "headings", it's a list of references to headings
    that exist somewhere else. They're obviously related, they might
    contain the same text, it's reasonable to style their presentation
    similarly, but semantically they aren't the actual headings.

    So I'd apply a class to the <ul> and then use CSS to make them look the
    same. I wouldn't apply HTML heading markup to the list of references
    though.
    Andy Dingley, Jan 26, 2007
    #6
  7. Andrew

    Ben C Guest

    On 2007-01-26, Andrew <> wrote:
    > Hi,
    >
    > Can I have some suggestions for the most syntactically correct way to
    > make a bold heading within a list item? The page I am working on is:
    >
    > http://people.aapt.net.au/~adjlstrong/homer.html
    >
    > I have used the following but I have a few qualms:
    ><ul>
    ><li><strong>heading</strong>list info</li>
    ></ul>


    Is the qualm that you'd like the heading to be marked as <h1> or
    something similar?

    What you're doing is described in the CSS 2.1 spec as a "run-in header".

    Few browsers support display:run-in, but that doesn't matter, you could
    just make your heading <h1> and set ul h1 to display:inline and
    font-weight:bolder, maybe using some classes if that selector's too
    general.
    Ben C, Jan 26, 2007
    #7
  8. Andrew

    Andrew Guest

    On Fri, 26 Jan 2007 05:13:31 -0600, Ben C wrote:

    > On 2007-01-26, Andrew <> wrote:
    >> Hi,
    >>
    >> Can I have some suggestions for the most syntactically correct way to
    >> make a bold heading within a list item? The page I am working on is:
    >>
    >> http://people.aapt.net.au/~adjlstrong/homer.html
    >>
    >> I have used the following but I have a few qualms:
    >><ul>
    >><li><strong>heading</strong>list info</li>
    >></ul>

    >
    > Is the qualm that you'd like the heading to be marked as <h1> or
    > something similar?
    >
    > What you're doing is described in the CSS 2.1 spec as a "run-in header".
    >
    > Few browsers support display:run-in, but that doesn't matter, you could
    > just make your heading <h1> and set ul h1 to display:inline and
    > font-weight:bolder, maybe using some classes if that selector's too
    > general.


    Hi Ben,

    Thank you for that. Your idea is so clear I am disappointed that I did
    not think of it myself. Now that I can see that it can be done quite
    easily with a styled heading element I just have to decide if the
    gymnastics of doing it this way outweigh the ease of simply using <strong> :)

    Thanks again,

    Andrew
    --
    The STRONG Family Web Site
    http://www.strong-family.org
    Andrew, Jan 26, 2007
    #8
  9. Andrew wrote:
    > Hi,
    >
    > Can I have some suggestions for the most syntactically correct way to
    > make a bold heading within a list item? The page I am working on is:
    >
    > http://people.aapt.net.au/~adjlstrong/homer.html
    >
    > I have used the following but I have a few qualms:
    > <ul>
    > <li><strong>heading</strong>list info</li>
    > </ul>


    Well if it is a heading, why is it not a heading? If you want to change
    how it looks, jut change the style to suit!


    LI H3 { display: inline; }


    <ol>
    <li><h3>Paris kills Achilles.</h3> According to the urban [...]
    <ol>
    <li>&quot;Be careful now; for I might be made into [...]</li>
    </ol>


    > BTW making this page has been the only time I have missed Dreamweaver:
    > doing long nested lists by hand is a little soul-destroying :)


    Don't know, I just template and good old cut'n paste or play search and
    replace games!

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 26, 2007
    #9
  10. Andrew

    K A Nuttall Guest

    Andy Dingley wrote:

    > Hard to say, without seeing the code, but doesn't this mean that
    > you've marked up the whole list (many elements) as _one_ heading?


    I'm not sure if you're confusing me with the OP. If not, what I meant
    was that, when I create a heading for a list, I do not make it part of
    the list at all. I create a separate heading, before the list.

    Like this:

    <h2>Sub heading for list</h2>
    <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    </ul>


    --
    K A Nuttall
    www.yammer.co.uk
    Re-type the e-mail address how it sounds, remove .invalid
    K A Nuttall, Jan 26, 2007
    #10
  11. Andrew

    dorayme Guest

    In article <>,
    Andrew <> wrote:

    > BTW making this page has been the only time I have missed Dreamweaver:
    > doing long nested lists by hand is a little soul-destroying :)


    What sort of editor do you have? Have you got GREP pattern
    facilities in it? You can make patterns and semi automate much of
    this stuff. For example, I made a simple pattern replacement:

    ^ to be replaced by <li>

    meaning the start of any line in the selected number of lines
    gets an opening list item marker.

    $ to </li>

    closes. You can combine the two, save the pattern and use it
    repeatedly for all lists. You type or cut and paste your text. It
    is a natural to put each item on a separate line. You apply the
    Search and Replace and tidy up afterwards for anything. The <ul>
    is not worth worrying about. You type that in. Often a good text
    editro will have a command key set to close (in this case, to put
    in the </ul>)

    --
    dorayme
    dorayme, Jan 26, 2007
    #11
  12. Andrew

    Andrew Guest

    On Sat, 27 Jan 2007 07:54:27 +1100, dorayme wrote:

    snip >>>>>>
    >
    > What sort of editor do you have? Have you got GREP pattern
    > facilities in it? You can make patterns and semi automate much of
    > this stuff. For example, I made a simple pattern replacement:


    snip >>>>>

    Hi dorayme,

    I use Bluefish and until you mentioned it I was not aware that grep was
    built into it (Open Advanced ...). Having found it I guess I now need to
    learn to use it :)

    Andrew
    --
    The STRONG Family Web Site
    http://www.strong-family.org
    Andrew, Jan 26, 2007
    #12
  13. Andrew

    dorayme Guest

    In article <>,
    Andrew <> wrote:

    > On Sat, 27 Jan 2007 07:54:27 +1100, dorayme wrote:
    >
    > snip >>>>>>
    > >
    > > What sort of editor do you have? Have you got GREP pattern
    > > facilities in it? You can make patterns and semi automate much of
    > > this stuff. For example, I made a simple pattern replacement:

    >
    > snip >>>>>
    >
    > Hi dorayme,
    >
    > I use Bluefish and until you mentioned it I was not aware that grep was
    > built into it (Open Advanced ...). Having found it I guess I now need to
    > learn to use it :)
    >
    > Andrew


    Just one more thought, without GREP you can do a lot too with
    plain S&R. If there is a full stop at the end of each list item
    and they are one sentence jobs. You can target the stop and say
    to replace "." with ".</li> over some selected text. No matter
    about occasional two sentence list item, you can clean up later,
    the bulk of a long list can be done this way quicker then typing
    or even cutting and pasting the "</li>" after each item.

    Lots of other ways to skin this cat. Some editors can insert a
    "<li></li>" at a key command, you then type in between.

    Or better still, make yourself up a little template:

    <ul>
    <li></li>
    <li></li>
    <li></li>
    </ul>

    Make it longish and simply paste this in, further cut and paste
    more pairs to suit your list and type in the midst. The key to
    time saving is to think to do this beforehand.

    --
    dorayme
    dorayme, Jan 26, 2007
    #13
  14. Andrew

    Joe (GKF) Guest

    In article <doraymeRidThis-D213FE.09503227012007@news-
    vip.optusnet.com.au>, says...

    > >
    > > snip >>>>>
    > >


    > or even cutting and pasting the "</li>" after each item.
    >


    I like to use S&R to put </li><li> at the end of each item. Saves me
    having to put <li> at the beginning. Often I just [ctrl]+v my way down
    the list



    --
    JOE
    Joe (GKF), Jan 27, 2007
    #14
  15. Andrew

    Toby Inkster Guest

    Joe wrote:

    > I like to use S&R to put </li><li> at the end of each item. Saves me
    > having to put <li> at the beginning. Often I just [ctrl]+v my way down
    > the list


    FWIW, the '</li>' tag is optional in HTML, so if you're not using XHTML,
    creating a list in a reasonably featureful text editor is as simple as
    selecting an area, doing a regular expression search and replace
    equivalent to 's/^/<li>/g' and then topping and tailing it with
    '<ul>...</ul>' or '<ol>...</ol>'.

    Even if you're using XHTML, you just need to use a slightly more
    complicated search and replace: s/^(.+)$/<li>\1<\/li>/g

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jan 27, 2007
    #15
  16. Andrew

    freemont Guest

    On Sat, 27 Jan 2007 11:49:24 +0000, Toby Inkster writ:

    > s/^(.+)$/<li>\1<\/li>/g


    I don't understand the backslash-one in this. What does it do?

    --
    "Because all you of Earth are idiots!"
    ¯`·..·¯`·-> freemont© <-·¯`·..·¯
    freemont, Jan 28, 2007
    #16
  17. freemont wrote:
    > On Sat, 27 Jan 2007 11:49:24 +0000, Toby Inkster writ:
    >
    >> s/^(.+)$/<li>\1<\/li>/g

    >
    > I don't understand the backslash-one in this. What does it do?


    Takes the "stuff" matching in the first part with the "()" and puts it
    in the second part at the "\1", but I think in Perl "$1" is preferred


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 28, 2007
    #17
  18. Andrew

    freemont Guest

    On Sun, 28 Jan 2007 00:19:36 -0500, Jonathan N. Little writ:

    > freemont wrote:
    >> On Sat, 27 Jan 2007 11:49:24 +0000, Toby Inkster writ:
    >>
    >>> s/^(.+)$/<li>\1<\/li>/g

    >>
    >> I don't understand the backslash-one in this. What does it do?

    >
    > Takes the "stuff" matching in the first part with the "()" and puts it
    > in the second part at the "\1", but I think in Perl "$1" is preferred


    Gotcha. Yes, $1 makes more sense to me. Thank you.

    --
    "Because all you of Earth are idiots!"
    ¯`·..·¯`·-> freemont© <-·¯`·..·¯
    freemont, Jan 28, 2007
    #18
  19. Andrew

    Toby Inkster Guest

    Jonathan N. Little wrote:

    > Takes the "stuff" matching in the first part with the "()" and puts it
    > in the second part at the "\1", but I think in Perl "$1" is preferred


    Some regexp engines use $1, others use \1. My text editor uses the
    backslash syntax.

    Perl supports both, but treats them slightly differently. For example:

    #!/usr/bin/perl
    print "Type a sentance> ";
    $_ = <>; # Read a line.
    s/^(.+)\s+(.*)/$2 $1/; # Swap around first 2 words.
    s/^(.+)\s+(.*)/\2 \1/; # Swap them back.
    if (/^(.+)\s+/) # If the sentance starts with a word
    { $first = $1; } # Put it in $first.
    if (/^(.+)\s+/) # Try this again...
    { $first = \1; } # Doesn't do what you expect!

    That is, $-style backreferences become available to the rest of your
    program until they get overwritten; \-style ones are only available
    within the original regular expression.

    PHP allows \1 and $1 and also, in line with PHP's string interpolation
    synatx, ${1} and {$1}. They are all treated as equivalent, but the
    curly braces ones are useful for distinguishing between ambiguous
    cases. For example: '${12}' versus '${1}2; the former is backreference
    twelve followed by nothing; the latter is backreference one followed by
    the literal string '2'.

    sed uses \1 to \9. The $-syntax is not recognised, and backreferences \10
    and higher are not supported.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jan 28, 2007
    #19
  20. Andrew

    Andy Dingley Guest

    On 26 Jan, 14:47, K A Nuttall <>
    wrote:

    > what I meant was that, when I create a heading for a list, I do not make it part of
    > the list at all. I create a separate heading, before the list.


    That's what I thought you meant. A perfectly fine way to put a heading
    onto the overall list. I think the OP was after a way of treating
    individual elements of the list as "headings". This is a different
    requirement, so the implementation ends up different.
    Andy Dingley, Jan 29, 2007
    #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. Saravana

    Re: Datagrid headings

    Saravana, Jul 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    427
    Saravana
    Jul 23, 2003
  2. Tracey
    Replies:
    0
    Views:
    358
    Tracey
    Jul 23, 2003
  3. Kathy Burke
    Replies:
    2
    Views:
    3,701
    Kathy Burke
    Nov 11, 2003
  4. =?Utf-8?B?QWxhbiBMYW1iZXJ0?=

    Headings in the DataGrid Web Control

    =?Utf-8?B?QWxhbiBMYW1iZXJ0?=, Sep 29, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    723
    =?Utf-8?B?Y29vbHRlY2g3Nw==?=
    Mar 5, 2006
  5. Bazza Formez
    Replies:
    2
    Views:
    375
    Bazza Formez
    Dec 8, 2004
Loading...

Share This Page