Skip to Content


Public news / February 2006 / DIVless

DIVless

An experiment with using unordered lists for layout structure instead of DIVs.

permanent link 24 feb at 06:46 by P.J. Onori

There are 13 guest comments so far.

commentat 14:37 on 24 February 2006, Veracon wrote:

(I e-mailed you about this, but heck, I'll comment.) While I totally agree on coding semantically, and do it myself as far as possible, I don't agree with this approach. Divisions are indeed very unsemantic, but lists definitely don't seem semantic either.

The best way to do it is to simply remove all those divisions you really don't need, constructing the same layout in a different way. Not just replacing all the divisions with other tags.

commentat 16:10 on 24 February 2006, Wayne wrote:

I agree. I think its about replacing divs that are not needed not replacing them all. Great bit of code though.

commentat 17:22 on 24 February 2006, Maleika E. Attawel wrote:

Lists are elements that should only be used for, well, lists. Using lists for items on the page that aren't lists, is pure semantic violation. I see no sense in replacing divs. Their purpose is to divide content and that's where and when they should be applied. Unordered lists have a semantic purpose and should be used for that purpose only. I prefer a semantic approach to designing which is why I do not agree with your method. :)

commentat 18:11 on 24 February 2006, P.J. Onori wrote:

Thanks for the comments guys. I agree, it's definitely out of the norm. I'm not sure if I would go as far to say that it's a pure semantic violation. However, I can agree that it's stretching the definition of what a list semantically is. I totally understand your positions though - I think it throws up a good discussion.

Thanks for the comments guys. :)

commentat 19:50 on 24 February 2006, john wrote:

I think this is an interesting idea, and I have to say I am surprised by the comments so far. These example do not violate a "semantic approach" to design; they embody it. The semantic purpose of lists is to convey a hierarchical content structure, which is what these examples are doing. Divs are just empty containers, without much meaning. Using divs to separate content may have more of a semantic purpose than using, say, tables, but all you are doing is grouping things in a very general way: you've lost the hierarchy. Nesting divs merely recreates the hierarchy that lists already possess.

commentat 20:03 on 24 February 2006, Maleika E. Attawel wrote:

Violation in semantic terms. The question is, does it matter? Maybe not. Divs have no semantic meaning at all. But I'd still say using lists to create your entire layout structure is semantically incorrect. This is only my personal opinion. However, what I really like about your approach is that you've given me food for thought. :)

commentat 20:46 on 24 February 2006, john wrote:

Maleika, can you explain why you think this is semantically incorrect? It's not a "layout structure" (which is visual) but a semantic structure, which has to do with meaning: P.J. is using lists to delineate a semantic hierarchy. I'm not arguing with you, just curious. :)

commentat 00:40 on 25 February 2006, Maleika E. Attawel wrote:

Hi John,

this quote by p.j. is what I have a problem with personally:

"The question is, does it make sense to use those very same tags to create the visual structure of a site. Semantically, there’s nothing in the definition of an unordered list to say it isn’t technically correct. In my opinion, it all comes down whether you’re willing to look at the meaning and use of lists as well as the organization and structure of information in a relatively non-traditional manner."

Nonetheless I find it an interesting approach.

commentat 04:59 on 25 February 2006, David B. wrote:

I thought by giving a div a logical id you are thus giving it meaning. do you mean to tell me that designing with divs is wrong? just as wrong as tables? if so what the hell are we supposed to be using? and how do visually design the page using unordered list where one of the nestd items needs to float or be placed absolutely, which takes it out of the natural flow of the page?

commentat 06:44 on 25 February 2006, P.J. Onori wrote:

Whoa man, I never said designing with DIVs was wrong. I stated it was an interesting alternative that in my opinion added more semantical heirarchy and organization. Please don't read too much into this - it's intended for experiment and debate.

commentat 17:29 on 25 February 2006, David B. wrote:

I wasnt talking to you PJ, more to the others here who have said that designing with divs is non semantic and some who have asserted that we should not use them at all

commentat 18:02 on 25 February 2006, john wrote:

Who said that? I don't see that anywhere on this page. I think you're reading to much into things. No one said you shouldn't use divs or that they are "non semantic." I just pointed out that lists ALSO have meaning. Lists are hierarchical; even though divs can be hierarchical, hierarchy is already intrinsic to the nature of lists. Is that really so radical?

commentat 18:35 on 27 February 2006, Miguel wrote:

DIVs do not currently have semantic meaning only because we choose not to bestow any upon them.

Nevertheless, DIVs (imperfect as they may be) are already well-received and widely used for their original purpose as containers. Why not just give them a slot on the semantic hierarchy, decide on their definition (to satisfy the hair-splitters), and move on?

Add a comment:

(required, non-public)

  |  Chars left: 1000

Keep the comment relevant, constructive and be polite.
A valid email address or URL to your site must be provided, or the comment might get deleted. Content seemed inappropriate or offensive may be edited and/or deleted. Avoid explicit language and words such as "sucks" and "ripoff". For more in-depth discussions use our forum. Email addresses are never displayed. Line breaks and paragraphs are automatically converted - no need to use <p> or <br/>. Quotes & apostrophes are automatically converted to smart punctuation. Be careful when copying and pasting portions of entries or other comments. The following inline HTML elements may be used: <strong><em><pre><q><blockquote><code>. All other code will get removed before posting. Don't forget to close your tags.


Search the archive

Stylegala news archive

Public news archive

News contributors


Features

Stylegala BookStore
The Stylegala BookStore has a massive archive of great books for you as a professional..
Bullet madness
Bullet madness is a list of 200 bullets, arrows and icons uploaded by our users.
CSS Reference
An alphabetical list over the most common CSS1 and CSS2 syntax and properties.

Sponsors

Logo design for $149

Advertise here