Appropriate Markup for a Question and Answer List

no, Stomme poes, you are not the one i was pointing at, no way! i’m sorry and i apologize if you felt that way! you never posted something that made me feel uncomfortable!

as for anchors and why i brought them in our argument. you said that dl provides a way to define a relationship between two elements. i’ve said that in html the anchor mechanism is the one doing that. then why not use anchors for defining the relation between "Q"s and "A"s? because it’s just not the way to do it.

just like dl, which purpose is far from providing such a feat. one can broaden the spectrum for their use, but, i repeat, html semantics (right use of elements) != text semantics (belletristic purpose). html semantic disregards text purpose or meaning. you imply that html should look for inside text relationships and outline them. not possible.

also, there are a series of issues that cannot be resolved with the use of dl regarding the subject of Q&As: when Q and A are more than inline, and neither fit in a dt, when Q is on one page, A is on another and probably other.

and strictly from dl point of view, an answer is not a definition for a question. it implies many wrongs for the sake of an apparent structural match.

and hyperlinks are doing what?

I have no freaking clue. Someone asked about question-and-answer markup and you mysteriously started talking about anchors for some reason!?! I’m sorry, I don’t understand your non-sequiturs. If it wasn’t a non-sequitur, then you’ll have to explain because I can’t read your mind.

And in case you’re wondering, demanding clarity isn’t picking on you… I’m just totally not getting whatever it is you’re trying to say there.

As for this:

not so. while a real dictionary term may have multiple definitions, all of which are correct, in a Q&A, a question having multiple answers may have only one (if any) correct answer.

Doesn’t matter what the answer is, or how many there could be. Why would it? Who determines you can only have one correct answer in a Q&A? Who made this rule??

same here, but that shouldn’t stop any of us entering a civil argument and presenting our point of view :slight_smile: just because things can be interpreted in so many ways!

Off Topic:

and presenting our point of view shouldn’t be taken by others as an opportunity to feel better by bashing you :slight_smile: (i’m not pointing at you AlexDawson :slight_smile: !)

and hyperlinks are doing what? :slight_smile:

With all HTML I don’t think there’s a “best way” (in many cases), it’s about what makes the most sense under the circumstances. I’m pretty flexible when it comes to semantic usage as I believe it’s not really a matter of dogmatic law as to what you use but the context you use it in and the reasoning behind it that matters most. :slight_smile:

ok :slight_smile: good point! but this only shows the power of dl when used properly!

it seems that the only thing left to clarify is the degree of generalization for this method.

if you apply it to Q&As to describe the relation between bits of content, would you go as far as to us it for sections = dl:

  • section header = dt
  • section content = dd
    like a chapter in a book or a section in a programming tut?

because it only seems logic to do so, if you have a consistent programming behaviour.

if it’s only an exception, is it the best way? because exceptions have a way of turning on you later. and all that regardless of the fact that an answer it’s not a definition for a question!

@Stevie D

thank you. you didn’t have to, though :slight_smile: but ask yourself this: did you make any valid points ? in the above post, at least.

a best solution applies successfully in all scenarios. if there are (some) scenarios where this solution needs a fallback, then i suggest changing its name from “the best solution” to “a solution” :slight_smile:

i’ve seen the same argument in a discussion regarding the use of dl for forms. it made more sense there than here, but still, it wasn’t enough.

you seem to mix up html element’s semantics (the right element for the right content) with author’s semantics (pure belletristic).

if you mean html element’s relationship, than you are referring to label/input relationship, (ul,ol)/li relationship and so on.

if you mean author’s text relationship, what are you going to do when the text makes a reference to content in another page? use dl to draw that relationship? :slight_smile:

if you’re looking to spare markup, you should consider using <center> more often :slight_smile: this policy of achieving more with less works, just not that well sometimes.

if you look enough to see there are two ways i’ve marked up the "Q"s and "A"s. using

<span><b>Q: </b></span>

gives my markup a distinct look when no CSS, but if you rather not (i don’t see why you are so against its use in html 4.01 though), you can use

<span>Q: </span>

for when CSS may come along.

together, html only speaking at first, it makes the more sense.
first

<p><b>Q: </b> ...</p>

and then, for CSS purpose

<p><span><b>Q: </b></span>...</p>

(like the <div>s).

i believe that CSS (and HTML constructs for pure CSS purpose, that are not involving content whatsoever) it’s the last one on the list. so, your html markup needs to make sense considering first that CSS is not an option. ie, will also look good :slight_smile:

yes, i agree it would give a wrong meaning. html semantics and text semantics don’t mix!

i’m going to ignore the last part. i like a good argument when it’s good. taking things out of context and paint them a different colour… not my business. :slight_smile:

back to the point: html is html because of the anchors. now, if you really want to draw a relation between parts of content, you should use anchors.

there are infinite cases where parts of content make belletristic pairs, but that doesn’t justify the use of dl. like, for example, a section should be a dl: dt for heading dd for content. and so on :wink:

do you wrap all these pairs in a dl? no. why? if you are thinking of using dl for Q&As, you anser ! :slight_smile:

:slight_smile: not what i meant and you know it !

In regards to your comments noonope, the idea of using definition list for the base pairs is entirely correct, in circumstances where the answers proceed the question it doesn’t make a difference whatsoever to the semantic usage. The point of a definition title isn’t strictly to pose a question (in the context of usage), it’s to provide a lead which relates heavily to the subsequent information. In the context whether question or answer first, the description should relate directly as a result of the relationship of the first item. Thereby even though it’s straining the implementation of what DL’s were produced for, I would say that it’s far better to define a loose semantic relationship between the two values in opposition to your suggestion of a couple of paragraphs which have no relationship and thereby apart from cascading in order, they could quite easily be totally unrelated. Though I would agree to a certain extent with you that perhaps a better solution may be to use a low heading (such as an H4 or H5) with the paragraph of related content following it (in order to relate the content outside of the contexts of defined relative content). :slight_smile:

let me say this once again: html semantics and text semantics don’t mix!

I disagree.

leaving aside this, what base do you have for assigning questions to dt and answers to dd? based on the fact that questions came first? i guess you’re wrong again. remember a little game where at first you got the answer and you need to provide the question?

Irrelevant. The point is they are a pair. A key-value pair. Two p’s do not have that relationship.

secondly, dt only takes inline. what if you question is longer than a grumpy old man’s talk?

Then I would use the solution that would still allow me to keep the pair relationship.

need more arguments against? try using tables for layout: it makes sense but you better think twice!

I don’t consider a Q&A pair to be tabular data.

less means more!

Are you making a Unix joke there? : )

let me say this once again: html semantics and text semantics don’t mix! you are trying to use html semantics to depict text semantic. it’s just not possible to assign html elements to belletristic meanings :slight_smile:

leaving aside this, what base do you have for assigning questions to dt and answers to dd? based on the fact that questions came first? i guess you’re wrong again. remember a little game where at first you got the answer and you need to provide the question?

secondly, dt only takes inline. what if you question is longer than a grumpy old man’s talk? :slight_smile:

need more arguments against? try using tables for layout: it makes sense but you better think twice!

For these short questions and answers personally I have probably gone with plain old paragraph it’s more than suitable enough.

If you wanted to expand it you could go with headings:

<h3>Question One</h3>
<p>When a vault guard enters and says: “Hello Stranger, who are you?”… How, do you get rid of him quickly?</p>
<h3>Answer</h3>
<p>You say your name is; “Croesus”.</p>

If your answers are going to be of that kind of length then you probably are right to use a <dl>. It doesn’t seem quite right, and I think that’s because of the way you’re asking a question rather than giving a defined term, but I can’t think of a better method.

In an ideal world, you could do without the Q: and A: in the code - if you want them in the display, you can add them back in with the :before pseudo-class. Unfortunately, that fails on IE7 and below, so for now you can only do that if you don’t mind 1 in 5 of your visitors not seeing them.

If your answers were longer, I’d recommend using <h*> and <p> elements, but that wouldn’t seem appropriate for such short extracts.

Really? I can’t speak for Stomme, but I very rarely know what you mean, your writing style and your arguments wander all over the place, and half the time you seem to be arguing just for the sake of it, making up spurious examples that have no bearing on the original question, the point you’re answering or any form of reality…

Technically it’s fine, although, as this page points out, some people argue against using a <dl> for a dialogue, which is sort of what you are presenting here. Still, off the top of my head, I can’t think of a better element or method for marking this up… but that doesn’t mean there isn’t one! :wink: