What xhtml element to use?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

What xhtml element to use?

Post by seodevhead »

I have a message posting board, similar to a very simple forum. And it lists the title of the message, a snippet and then under that it simply says:

"Posted By: {username here}"

Since this "posted by" line is a block level element (on its own line) I am now wondering what xhtml element(s) to assign to this?

I had it originally in a <p> tag but it certainly is not a paragraph. The only other option I can see is using a <dl> definition list perhaps... kinda like:

<dl><dt>Posted By:</dt><dd>{username here}</dd></dl>

Any suggestions as to what I should use? I want to comply with web standards/accessibility as much as humanly possible. Thanks.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

fieldset/label, div, table/th ?
chenggn
Forum Newbie
Posts: 6
Joined: Tue Sep 05, 2006 3:41 am

Post by chenggn »

:D

yeah, why not put it inside a table cell. just like phpbb and many other forums.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

I would think a p is fine. It's just a short paragraph. Give the p a class to be able to style it. Otherwise you could use a div.

To make it even more difficult: you could also place everything in a list. It is a list of messages isn't it? But the drawback of that is that it might be a bit challenging to get everything the way you want it to look. I guess that's why most forums still use tables.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

[ ... drums rolling ... ]
Aaaaand, Weeeeirdan wins and goes on for the washing machine!!!!
:)
Post Reply