Poll HTML Markup

Discussion in 'HTML' started by shapper, Sep 25, 2008.

  1. shapper

    shapper Guest

    Hello,

    I am displaying a poll to a user that has 1 question and 4 answers. I
    am using the following HTML markup:

    <h3>Question</h3>
    <ul>
    <li>Answer 1</li>
    <li>Answer 2</li>
    <li>Answer 3</li>
    <li>Answer 4</li>
    </ul>

    Is this correct? Should I also place the Question in a list item
    dropping the header?

    Or maybe using a <p> for the question?

    Thanks,
    Miguel
     
    shapper, Sep 25, 2008
    #1
    1. Advertising

  2. shapper

    Els Guest

    shapper wrote:

    > I am displaying a poll to a user that has 1 question and 4 answers. I
    > am using the following HTML markup:
    >
    > <h3>Question</h3>
    > <ul>
    > <li>Answer 1</li>
    > <li>Answer 2</li>
    > <li>Answer 3</li>
    > <li>Answer 4</li>
    > </ul>
    >
    > Is this correct? Should I also place the Question in a list item
    > dropping the header?
    >
    > Or maybe using a <p> for the question?


    I think I'd go for using a <p> for the question, and have the <h3> (or
    whichever level of heading is appropriate for it) saying something
    like "Poll". It's not a crime to place the question in the <h3>
    though, just don't use it in the list, as it is not part of the list.

    --
    Els http://locusmeus.com/
     
    Els, Sep 25, 2008
    #2
    1. Advertising

  3. Els wrote:
    > shapper wrote:
    >
    >> I am displaying a poll to a user that has 1 question and 4 answers. I
    >> am using the following HTML markup:
    >>
    >> <h3>Question</h3>
    >> <ul>
    >> <li>Answer 1</li>
    >> <li>Answer 2</li>
    >> <li>Answer 3</li>
    >> <li>Answer 4</li>
    >> </ul>
    >>
    >> Is this correct? Should I also place the Question in a list item
    >> dropping the header?
    >>
    >> Or maybe using a <p> for the question?

    >
    > I think I'd go for using a <p> for the question, and have the <h3> (or
    > whichever level of heading is appropriate for it) saying something
    > like "Poll". It's not a crime to place the question in the <h3>
    > though, just don't use it in the list, as it is not part of the list.
    >


    Style as you wish:

    p.question { font-size: 1.25em; font-weight: bold; }
    ul.answers { ... }

    <h1>The Foo Poll</h1>
    <p class="question">Question....?</h3>
    <ul class="answers">
    <li>Answer 1</li>
    <li>Answer 2</li>
    <li>Answer 3</li>
    <li>Answer 4</li>
    </ul>


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Sep 25, 2008
    #3
  4. Gazing into my crystal ball I observed shapper <>
    writing in news:187596bf-a3cd-46a6-8a85-f527b53ea459@
    25g2000hsx.googlegroups.com:

    > Hello,
    >
    > I am displaying a poll to a user that has 1 question and 4 answers. I
    > am using the following HTML markup:
    >
    ><h3>Question</h3>
    ><ul>
    > <li>Answer 1</li>
    > <li>Answer 2</li>
    > <li>Answer 3</li>
    > <li>Answer 4</li>
    ></ul>
    >
    > Is this correct? Should I also place the Question in a list item
    > dropping the header?
    >
    > Or maybe using a <p> for the question?
    >
    > Thanks,
    > Miguel


    This would be a good candidate for a definition list, eg:

    <dl>
    <dt>What is the not color of an apple?</dt>
    <dd>Red</dd>
    <dd>Green</dd>
    <dd>Blue</dd>
    <dd>Yellow</dd>
    </dl>

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Sep 25, 2008
    #4
  5. Adrienne Boswell wrote:

    > This would be a good candidate for a definition list, eg:


    No it wouldn't.

    > <dt>What is the not color of an apple?</dt>


    Why do you claim that "What is the not color of an apple?" is a term that
    you are defining? It ain't no term. It's a question. Well, a grammatically
    malformed question, but still. It does not even _contain_ a term, just
    common English words.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Sep 25, 2008
    #5
  6. shapper wrote:

    > I am displaying a poll to a user that has 1 question and 4 answers.


    Why do you call it a poll? Is this a _presentation_ of a poll (in a document
    _about_ some study)? Or is it supposed to _be_ a poll? If it is, where does
    the user enter his answer? If this is really part of a form, you should say
    it, since it really matters, for markup purposes and otherwise.

    > <h3>Question</h3>


    Do you have 1st and 2nd level headings at higher structure levels? If not,
    you should not use markup for a 3rd level heading.

    "Question" is seldom a good heading. Yes, you meant it as a placeholder, but
    it is all-important what kind of questions you _really_ have there. If they
    are short, you could make them headings at a suitable level. Otherwise, you
    should perhaps use short headings that describe the topic of the question,
    followed by a paragraph (or maybe <div>) that contains the question itself.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Sep 25, 2008
    #6
  7. Gazing into my crystal ball I observed "Jukka K. Korpela"
    <> writing in
    news:yROCk.71333$:

    > Adrienne Boswell wrote:
    >
    >> This would be a good candidate for a definition list, eg:

    >
    > No it wouldn't.
    >
    >> <dt>What is the not color of an apple?</dt>

    >
    > Why do you claim that "What is the not color of an apple?" is a term
    > that you are defining? It ain't no term. It's a question. Well, a
    > grammatically malformed question, but still. It does not even
    > _contain_ a term, just common English words.
    >


    Bad choice of question and answer, I agree. However, I still think that
    a definition list would work here. After all, a question and answer are
    a name/value pair, and a word/definition(s) are also a name/value pair.

    In reality, the OP would be better off with a label and radio or check
    box inputs.


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Sep 25, 2008
    #7
  8. Jukka K. Korpela wrote:
    > Adrienne Boswell wrote:
    >
    >> This would be a good candidate for a definition list, eg:

    >
    > No it wouldn't.
    >
    >> <dt>What is the not color of an apple?</dt>

    >
    > Why do you claim that "What is the not color of an apple?" is a term
    > that you are defining? It ain't no term. It's a question. Well, a
    > grammatically malformed question, but still. It does not even _contain_
    > a term, just common English words.
    >


    In the spec I don't see:

    "The name 'definition list' is meant literally and strictly and should
    only be used for the very special case of providing definitions for
    words, even though all of you will be hard-put to figure out why we'd
    create a special structure just for that one extremely narrow purpose."

    but I do see

    "Another application of DL, for example, is for marking up dialogues,
    with each DT naming a speaker, and each DD containing his or her words."

    which contradicts the notion that "definition list" was meant to be
    construed strictly, instead of based on its convenience as a term
    understood to connote this kind of general data structure, akin to the
    Dictionary object available in at least one programming library, which
    is nothing more than a map or hash table, and which is probably only
    very rarely used for the purpose of matching up terms to definitions.
     
    Harlan Messinger, Sep 25, 2008
    #8
  9. Harlan Messinger wrote:

    > In the spec I don't see:
    >
    > "The name 'definition list' is meant literally and strictly


    Bla bla. It still says <dl> is a definition list, and you can check any
    decent dictionary for a definition for "definition" if the word is not known
    to you.

    > which contradicts


    It has been said umpteen times that the HTML specs is self-contradictory in
    this issue and a few others. It still defines <dl> as definition list, even
    though it then contradicts, in descriptive prose, its own normative
    definition.

    The practical side of the matter is that it is more difficult to style a
    <dl> than some other markup for a list of Q/A pairs.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Sep 25, 2008
    #9
  10. On 2008-09-25, Jukka K. Korpela wrote:
    > Harlan Messinger wrote:
    >
    >> In the spec I don't see:
    >>
    >> "The name 'definition list' is meant literally and strictly

    >
    > Bla bla. It still says <dl> is a definition list, and you can check any
    > decent dictionary for a definition for "definition" if the word is not known
    > to you.


    The definitions given in my dictionaries could easily include
    questions and answers.

    >> which contradicts

    >
    > It has been said umpteen times that the HTML specs is self-contradictory in
    > this issue and a few others. It still defines <dl> as definition list, even
    > though it then contradicts, in descriptive prose, its own normative
    > definition.
    >
    > The practical side of the matter is that it is more difficult to style a
    ><dl> than some other markup for a list of Q/A pairs.


    That's news to me; I've never seen any difficulty in styling them.


    --
    Chris F.A. Johnson, webmaster <http://Woodbine-Gerrard.com>
    ===================================================================
    Author:
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
     
    Chris F.A. Johnson, Sep 25, 2008
    #10
  11. shapper

    dorayme Guest

    In article <>,
    Els <> wrote:

    > shapper wrote:
    >
    > > I am displaying a poll to a user that has 1 question and 4 answers. I
    > > am using the following HTML markup:
    > >
    > > <h3>Question</h3>
    > > <ul>
    > > <li>Answer 1</li>
    > > <li>Answer 2</li>
    > > <li>Answer 3</li>
    > > <li>Answer 4</li>
    > > </ul>
    > >
    > > Is this correct? Should I also place the Question in a list item
    > > dropping the header?
    > >
    > > Or maybe using a <p> for the question?

    >
    > I think I'd go for using a <p> for the question, and have the <h3> (or
    > whichever level of heading is appropriate for it) saying something
    > like "Poll". It's not a crime to place the question in the <h3>
    > though, just don't use it in the list, as it is not part of the list.


    Perhaps it depends on the exact context. If there are a lot of questions
    then the questions could go in a list with the answers as sublists.

    --
    dorayme
     
    dorayme, Sep 25, 2008
    #11
  12. shapper

    dorayme Guest

    In article <yROCk.71333$>,
    "Jukka K. Korpela" <> wrote:

    > Adrienne Boswell wrote:
    >
    > > This would be a good candidate for a definition list, eg:

    >
    > No it wouldn't.
    >


    I agree with JK's instincts here. While there are analogies in 'data
    structure' (as Harlan says later and Adrienne obviously noticed), surely
    it is better practice to keep a tight reign on definition lists. So we
    all really know that it means how it sounds. No matter what the
    uncertainties are in the specs. It looks to me like a stretch to bring
    this tool in here even if it is somehow not forbidden. It would make it
    too waffly an element.

    There is no question and answer element, one must look to the context.
    In some, a p and an unordered list is appropriate (as Els says), in
    other contexts, a list with sub lists (as dorayme said). In yet others,
    an ordered list with unordered sublists or even other combinations of
    these two types of lists would capture the meaning and purpose of the
    communication. We have to see the actual case.

    And there is the fine magnificent (ever so often unwelcome) animal in
    the room we are all ignoring, the table! This could well be suited.
    There are the questions in the left columns and there are the answers in
    the right column. The right col associated cell could contain a list.
    This list could be ordered or not, depending if the answers have some
    sort of ordering characteristic about them. This characteristic could be
    mentioned in the table heading. The left col question cells could also
    perfectly meaningfully be constructed to rowspan the answer cells.

    There is no one answer, there are lots of ways to skin this cat.

    --
    dorayme
     
    dorayme, Sep 25, 2008
    #12
  13. shapper

    Els Guest

    dorayme wrote:
    > Els <> wrote:
    >> shapper wrote:


    >>> Is this correct? Should I also place the Question in a list item
    >>> dropping the header?
    >>>
    >>> Or maybe using a <p> for the question?

    >>
    >> I think I'd go for using a <p> for the question, and have the <h3> (or
    >> whichever level of heading is appropriate for it) saying something
    >> like "Poll". It's not a crime to place the question in the <h3>
    >> though, just don't use it in the list, as it is not part of the list.

    >
    > Perhaps it depends on the exact context. If there are a lot of questions
    > then the questions could go in a list with the answers as sublists.


    True, but I read the OP as using the question as the first list item
    of 5. Also, isn't a poll always a single question? (unless he has a
    bunch of polls together, then you'd get the list of poll questions of
    course)

    --
    Els http://locusmeus.com/
     
    Els, Sep 26, 2008
    #13
  14. shapper

    dorayme Guest

    In article <>,
    Els <> wrote:

    > dorayme wrote:
    > > Els <> wrote:
    > >> shapper wrote:

    >
    > >>> Is this correct? Should I also place the Question in a list item
    > >>> dropping the header?
    > >>>
    > >>> Or maybe using a <p> for the question?
    > >>
    > >> I think I'd go for using a <p> for the question, and have the <h3> (or
    > >> whichever level of heading is appropriate for it) saying something
    > >> like "Poll". It's not a crime to place the question in the <h3>
    > >> though, just don't use it in the list, as it is not part of the list.

    > >
    > > Perhaps it depends on the exact context. If there are a lot of questions
    > > then the questions could go in a list with the answers as sublists.

    >
    > True, but I read the OP as using the question as the first list item
    > of 5.


    You were right, I was just raising another possibility for a broader
    case.

    > Also, isn't a poll always a single question? (unless he has a
    > bunch of polls together, then you'd get the list of poll questions of
    > course)


    I am not sure there is any one meaning for "poll" that limits it to
    this. Some people might mean this following some internet trends, others
    might mean to allow for more questions.

    Anyway, it is always a slight challenge how to introduce lists and the
    general question of how it is to be done is a bit of a theme that comes
    up not so rarely. It is always a bit of a question whether to use a p or
    a div where it is not an obvious paragraph. Is "Are you over 6ft 5in
    tall?" really any kind of paragraph? I don't think it wrong to use a p
    here but perhaps because there is no exact element for this sort of
    thing, a div might be better on the grounds that a div is what you turn
    to when you are not quite sure. I think JK mentioned this alternative in
    this thread and I am sympathetic to this.

    You might know, later in the thread, I suggested a table would not be
    inappropriate either. All depends.

    --
    dorayme
     
    dorayme, Sep 26, 2008
    #14
  15. Jukka K. Korpela wrote:
    > Harlan Messinger wrote:
    >
    >> In the spec I don't see:
    >>
    >> "The name 'definition list' is meant literally and strictly

    >
    > Bla bla. It still says <dl> is a definition list, and you can check any
    > decent dictionary for a definition for "definition" if the word is not
    > known to you.
    >
    >> which contradicts

    >
    > It has been said umpteen times that the HTML specs is self-contradictory
    > in this issue and a few others. It still defines <dl> as definition
    > list, even though it then contradicts, in descriptive prose, its own
    > normative definition.


    Blah blah yourself, you blowhard. It has also been pointed out umpteen
    times that your arbitrary interpretation of the contradiction is not the
    only one that exists, and I already *addressed* your point about their
    selection of the word "definition" to name the element, so approaching
    the issue backwards by challenging me on whether I know what
    "definition" means shows just so much obliviousness on your part.
     
    Harlan Messinger, Sep 26, 2008
    #15
  16. dorayme wrote:
    > In article <yROCk.71333$>,
    > "Jukka K. Korpela" <> wrote:
    >
    >> Adrienne Boswell wrote:
    >>
    >>> This would be a good candidate for a definition list, eg:

    >> No it wouldn't.
    >>

    >
    > I agree with JK's instincts here. While there are analogies in 'data
    > structure' (as Harlan says later and Adrienne obviously noticed), surely
    > it is better practice to keep a tight reign on definition lists.


    Why? Why "surely"?

    > So we
    > all really know that it means how it sounds. No matter what the
    > uncertainties are in the specs. It looks to me like a stretch to bring
    > this tool in here even if it is somehow not forbidden. It would make it
    > too waffly an element.


    Would it be fair to call the form element too waffly because it isn't
    called <orderform> and restricted to uses involving the ordering of
    merchandise? As I see it, the fact that none of the other structured
    elements expresses a restricted purpose in that manner makes it unlikely
    that in the case of this one element such a restriction of purpose was
    either intended or desirable.
     
    Harlan Messinger, Sep 26, 2008
    #16
  17. shapper

    dorayme Guest

    In article <>,
    Harlan Messinger <> wrote:

    > dorayme wrote:
    > > In article <yROCk.71333$>,
    > > "Jukka K. Korpela" <> wrote:
    > >
    > >> Adrienne Boswell wrote:
    > >>
    > >>> This would be a good candidate for a definition list, eg:
    > >> No it wouldn't.
    > >>

    > >
    > > I agree with JK's instincts here. While there are analogies in 'data
    > > structure' (as Harlan says later and Adrienne obviously noticed), surely
    > > it is better practice to keep a tight reign on definition lists.

    >
    > Why? Why "surely"?
    >


    A fair question question. I do my best to answer it below.

    > > So we
    > > all really know that it means how it sounds. No matter what the
    > > uncertainties are in the specs. It looks to me like a stretch to bring
    > > this tool in here even if it is somehow not forbidden. It would make it
    > > too waffly an element.

    >
    > Would it be fair to call the form element too waffly because it isn't
    > called <orderform> and restricted to uses involving the ordering of
    > merchandise? As I see it, the fact that none of the other structured
    > elements expresses a restricted purpose in that manner makes it unlikely
    > that in the case of this one element such a restriction of purpose was
    > either intended or desirable.


    A form is what you fill in when you apply for things or give answers to
    set questions. The purpose *is* general in this respect. Something meant
    to be filled in and handed over or sent.

    Restricting it to the ordering of merchandise would indeed be too
    restrictive. Yes, I know, this is your point. But it does not say
    anything at all about a free for all in what a form is. Forms are
    already known in many walks of life for all sorts of things. That does
    not mean they are *meant* for just some narrow things or for about
    anything, however useful (eg, to be rolled up to shoo the cat away).

    When teaching someone what a form is, I would have thought that there
    would be central cases, paradigm cases. One might mention ordering
    merchandise as an example, as well as many other things. But not the
    possibility of using paper versions to scare cats away. There are some
    things outside of what is reasonable to keep a good common understanding
    of its meaning and purpose. What is in the centre is a matter of
    judgement.

    It seems rather odd to me for a definition list to be anywhere near a
    question and answer. It simply is nothing to do with defining terms, as
    simple as that. I don't like the idea when there are so many *perfectly
    good* means to carry out this task. (Els gave one, JK gave variations, I
    gave some, including a table)

    We can go your way and seize on that data structure point. Data
    structure is your way of seeing a two part structure that one can slot
    in a pair of things like a question and an answer, or a more complicated
    pair where the first item is an object like a question and the second is
    a *set* of answers to the first item. But if you allow this to be the
    main reason then you are risking a mindset that makes what would be a
    terrifically meaningful element into something vague and less useful.
    The idea of a definition list is to expand on something at the very
    least. An answer to a question is not an expansion of any kind. It is a
    different beast altogether.

    Vague and less useful? Yes, less useful. It is very easy to suppose that
    a word, for example, becomes more useful the wider its meaning. But I
    trust you will see that this is simply not so. In the same way, if you
    extend the idea of definition list to include all sorts of things
    because of some inviting or tempting structure, then you empty the
    element of meaning because it makes it harder for browsers to know how
    to present them, how to read them out, how to braille them up. Meaning,
    as far as a browser is concerned, *is* presentation and the narrower the
    meaning, the easier to present it in a way that humans will recognise.

    In all of these things, I reckon we need to keep an eye out for what is
    good rather than what is black letter law in 'the specs'. Though,
    interestingly, JK paints a picture of contradiction there. But I am nt
    relying on that.

    Btw, I have thought a little more on my previous suggestion about a list
    of questions with sublists to each question for the answer and I am not
    altogether happy with it, the answers are not sublists of the questions.
    It took what I regard as this not altogether happy suggestion about
    definition lists to make me realise my own mistake. I was too quick to
    draw on data structure analogies. But I still stand by the div
    version/list or table solutions.

    --
    dorayme
     
    dorayme, Sep 27, 2008
    #17
    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. Michal A. Valasek

    How to strip HTML markup from string?

    Michal A. Valasek, Aug 9, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,286
    Yan-Hong Huang[MSFT]
    Aug 12, 2003
  2. Tim Zych
    Replies:
    2
    Views:
    515
    Tim Zych
    Nov 21, 2005
  3. shapper
    Replies:
    3
    Views:
    425
    Adrienne Boswell
    Oct 8, 2008
  4. birdsong

    select.poll.poll() never blocks

    birdsong, Feb 12, 2009, in forum: Python
    Replies:
    2
    Views:
    462
    birdsong
    Feb 12, 2009
  5. Jean-Paul Calderone

    Re: select.poll.poll() never blocks

    Jean-Paul Calderone, Feb 12, 2009, in forum: Python
    Replies:
    3
    Views:
    452
    birdsong
    Feb 12, 2009
Loading...

Share This Page