The IPB3 skin designing is well underway, and thus far, is nicely semantic and valid. Headings are used where they should be, and divs don't litter the code.
That said, being semantic - in some cases - is easier said than done.
Take for example the post block. Semantics dictates that this should be a p tag - or more correctly, several p tags as necessary. This is how I coded the skin, and it works fine... until you consider it further. The problem is, the post block contains user-generated data. It's very difficult indeed to ensure that user-generated data remains valid. I'll use a list as an example. Imagine this is how a (bbcode inserted) list appeared in my nice, semantic post view:
The p tag should be closed before the list, and reopened after the list, since p tags can only include inline elements. But how should this be implemented? The obvious answer would be to have the BBCode start with a closing p tag, and end with another opening p tag to continue the post. For most purposes that'd work fine. But what if a post is exported by RSS to another site? What if one skin on a site has used a div for the post? Suddenly you've got a random </p> in your content.
And this is the problem. There's no guarantee that a post will be written or viewed as a designer might intend. A p tag with block-level elements inside will break (not to mention be invalid). I'm not suggesting that this problem is absolutely insurmountable - I'm sure with a lot of work we could come up with some intelligent skin logic that figures out when it should close individual tags and so on. But is that worth it? I'm not sure it is - which is why I'm now using a div tag as the post block. It's not 100% perfect in terms of semantics, but it's a whole lot easier to deal with technically.
Semantics are an important goal in modern web design. But sometimes, it really is easier said than done.
Footnote: Ironically, you'll notice that the text in this entry appearing after the code block has lost its formatting. This is because when Blog was designed, p tags were used for the entry. This nicely illustrates the problem! In the next release of blog, those p tags will also be changed to div.
That said, being semantic - in some cases - is easier said than done.
Take for example the post block. Semantics dictates that this should be a p tag - or more correctly, several p tags as necessary. This is how I coded the skin, and it works fine... until you consider it further. The problem is, the post block contains user-generated data. It's very difficult indeed to ensure that user-generated data remains valid. I'll use a list as an example. Imagine this is how a (bbcode inserted) list appeared in my nice, semantic post view:
CODE
<p class='post'>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce nec ante. Ut consequat. Fusce ultrices rhoncus dui. Nam vulputate, augue sed iaculis tempor, felis pede laoreet libero, at adipiscing sem justo id arcu.
</p>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
<p class='post'>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce nec ante. Ut consequat. Fusce ultrices rhoncus dui. Nam vulputate, augue sed iaculis tempor, felis pede laoreet libero, at adipiscing sem justo id arcu.
</p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce nec ante. Ut consequat. Fusce ultrices rhoncus dui. Nam vulputate, augue sed iaculis tempor, felis pede laoreet libero, at adipiscing sem justo id arcu.
</p>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
<p class='post'>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce nec ante. Ut consequat. Fusce ultrices rhoncus dui. Nam vulputate, augue sed iaculis tempor, felis pede laoreet libero, at adipiscing sem justo id arcu.
</p>
The p tag should be closed before the list, and reopened after the list, since p tags can only include inline elements. But how should this be implemented? The obvious answer would be to have the BBCode start with a closing p tag, and end with another opening p tag to continue the post. For most purposes that'd work fine. But what if a post is exported by RSS to another site? What if one skin on a site has used a div for the post? Suddenly you've got a random </p> in your content.
And this is the problem. There's no guarantee that a post will be written or viewed as a designer might intend. A p tag with block-level elements inside will break (not to mention be invalid). I'm not suggesting that this problem is absolutely insurmountable - I'm sure with a lot of work we could come up with some intelligent skin logic that figures out when it should close individual tags and so on. But is that worth it? I'm not sure it is - which is why I'm now using a div tag as the post block. It's not 100% perfect in terms of semantics, but it's a whole lot easier to deal with technically.
Semantics are an important goal in modern web design. But sometimes, it really is easier said than done.
Footnote: Ironically, you'll notice that the text in this entry appearing after the code block has lost its formatting. This is because when Blog was designed, p tags were used for the entry. This nicely illustrates the problem! In the next release of blog, those p tags will also be changed to div.
1 Comments On This Entry
Page 1 of 1
Page 1 of 1
← March 2010 →
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Recent Entries
-
-
When semantics is easier said than doneon Jun 30 2008 03:35 PM
-
-
-
XBox Live Gamercard
Disclaimer
Please note that none of my blogging is official IPS business. Opinions and other things I say are mine and not IPS'.
0 user(s) viewing
0 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
Sign In
Register
Help

1 Comments








