Skip to main content
Topic: Semantics, HTML5, and other gruesomeness.  (Read 14239 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Semantics, HTML5, and other gruesomeness.

Reply #15

Ah okay, sorry (I partially misunderstood). Thanks.
The best moment for testing your PR is right after you merge it. Can't miss with that one.

Re: Semantics, HTML5, and other gruesomeness.

Reply #16

Quote from: Xarcell – Interesting thoughts here. I would like to share my own...

Article tag should definitely be used. The W3C Spec says this:

QuoteThe article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

"Syndication", "reuseable" and "form post" being the keys words here.
Yeah, I know, but as I said their spec (which is nightly, not final) actually contradicts itself a bit, if you think about how forum posts often are in reality (IOW, not really stand alone items that would make sense out of their original context). If a convention develops where the article tag is used regardless of how much sense the content makes as an independently distributed item, then ok sure. At the moment it just seems a bit daft to me.

To my mind, the thread page is still a list of posts. That makes semantic sense to me on all levels. My 2c.


QuoteI agree that "catbg" and "titlebg" should not even be used anymore. It would be more appropriate to use the body class in conjunction with the header element. Example:

.action_messageindex h2, .action_home h2, .action_search h2 {
  background: green;
}
I'm trying to get away from descendant selectors as much as possible. Anyone whose coding is up to it can of course still write whatever they like, but for ease of customisation for n00bs I'm trying to give them a structure that primarily relies on clearly understandable class names and id's. Not full-on mental "OOCSS", but sorta tending in that direction.


QuoteAs far as the windowbg and windowbg2, I think they should be renamed to "content_bg" and "post_bg", not "postbg" and "postbg2", because not all areas which use the class is a post. I personally hate using numbers in classes unless it's semantically necessary such as a board number or topic number. Note, that you could also use "content_stn", "content_alt", and "post_stn" "post_alt" for more added flexibility(stn = standard).
I'd prefer to not use "_stn" as it's not immediately clear in meaning. I brings to mind "station" for me. My plan is to just use the standard classes without underscored suffixes, and add "_alt" to the alternate ones. I think that is clearer, as well as being slightly less verbose.

But yeah, "window" is bonkers and should be killed.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #17

Grmmpph.

 Antechinus just wants to go back to using nested tables for everything................ :D

Ok, not really. Can't stand nested tables. Been reading around a bit more, and thinking about stuff I've read. If the convention is that article gets used for forum posts, regardless of whether it would be an appropriate term for many forum posts from the perspective of the average English speaker*, then something like this seems like good markup for thread pages.

http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/

Specifically, an adaption of this part:
Code: [Select]
<section id="content" class="body">
 
<ol id="posts-list" class="hfeed">
 
<li><article class="hentry">
<header>
<h2 class="entry-title"><a href="#" rel="bookmark" title="Permalink to this POST TITLE">This be the title</a></h2>
</header>
 
<footer class="post-info">
<abbr class="published" title="2005-10-10T14:07:00-07:00"><!-- YYYYMMDDThh:mm:ss+ZZZZ -->
10th October 2005
</abbr>
 
<address class="vcard author">
By <a class="url fn" href="#">Enrique Ramírez</a>
 
</address>
</footer><!-- /.post-info -->
 
<div class="entry-content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo <a href="#">non sapien</a> dapibus blandit nec et leo. Ut ut malesuada tellus.</p>
 
</div><!-- /.entry-content -->
</article></li>

<li><article class="hentry">
...
</article></li>
 

<li><article class="hentry">
...
</article></li>
</ol><!-- /#posts-list -->
 
</section><!-- /#content -->

Not that I would do it identically for Elk, do to the way the gui is arranged, but the basic structure of an ol framework holding article tags makes sense to me. I was thinking of ul originally, but then the definition of ol makes more sense (ie: use ol where changing the order would scramble the meaning of the list).


* The sort of thing I'm thinking of is where you get a succession of posts that are just smileys, or one line replies to something that was said earlier (without linked quotes to the original post) or whatever. Things like that don't meet the definition of "article", either in W3C terms or in terms of common English usage. IOW, calling them articles is bad use of language, which is another way of saying it is bad semantics.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #18

And while I think of it, board index categories are going to be marked up like this (stripped most of the php for brevity):

Code: [Select]
		<section class="forum_category" id="category_', $category['id'], '">

<h2 class="category_header">';
<a class="collapse" href="#" title="">', $category['collapse_image'], '</a>
The usual board name....
</h2>

<ul class="category_boards" id="">';

<li class="board_row ', (!empty($board['children'])) ? 'parent_board':'', '" id="">
<div class="board_info">

<a class="icon_anchor" href="#">
<img class="board_icon" src="on.png" alt="" title="" />
</a>

<h3 class="board_name">
<a href="', $board['href'], '" id="b', $board['id'], '">
The usual board name....
</a>
</h3>

<p class="board_description">
Board description stuffz...
</p>

<p class="board_moderators">
The usual list of mods....
</p>

</div>

<div class="board_latest">

<p class="board_stats">
Post count...
Topic count...
</p>

<p class="board_lastpost">
Timestamp, post title, etc...
</p>

</div>
</li>

<li class="childboard_row">
<h4>', $txt['parent_boards'], ':</h4>
<ul class="childboards"> The usual list of child boards... </ul>
</li>

</ul>

</section>
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #19

I read a very interesting article about HTML5 , that at least changed my view a bit on how to approach things. It seems that section tags are way more important than I thought, and article,header,footer aren't the typical "for the whole page" kind of tags - but rather can be elements in each section tag.

I am sure Antech knows about it. :) But it was news to me, although I wondered often how to really outline headers etc. when you got 3 side-by-side panels - what order is semantically correct and if you change the order, will one be the parent of another then. It seems not. Need to read his e-book about this.

http://www.webdesignerdepot.com/2013/01/the-harsh-truth-about-html5s-structural-semantics-part-1/
http://www.webdesignerdepot.com/2013/01/the-harsh-truth-about-html5s-structural-semantics-part-2/
http://www.webdesignerdepot.com/2013/01/the-harsh-truth-about-html5s-structural-semantics-part-3/
Last Edit: June 30, 2013, 05:38:01 am by Bloc

Re: Semantics, HTML5, and other gruesomeness.

Reply #20

Y'know, this part from the first link, about halfway down the page, really hits the nail on the head IMO.

QuoteThe problem is, if you read the actual HTML5 specification, the elements in HTML5 are defined in a way that has little to do with how we have traditionally used them.

On the one hand, Hickson has introduced a whole new concept of structuring a web page in HTML5 with sectioning elements. On the other, Hickson is comparing his HTML5 sectioning elements to classes used in the wild with no understanding of what those classes were actually used for.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #21

Hey this bloke makes one hell of a lot of sense. Take his points about the h1-h6 tags. These points are entirely valid, IMO. I've been thinking the same thing myself. The specs do not take a11y and presentation* into account, which is another way of saying they don't consider how people actually want to use the web.


QuoteHTML5 wants to be backwards compatible, so the WHATWG decided not to introduce an h element (despite introducing a bunch of new sectioning elements), and instead wants to repurpose the h1 element to be the generic h element. Use h1 everywhere, and let the HTML5 outlining algorithm determine its true level… or so the theory goes.

This is a terrible idea for several reasons, the two main ones being accessibility and styling.

Accessibility

Using h1 everywhere is very bad for accessibility. Blind users rely heavily on the heading structure of a site. It’s important for all of us to be reminded of just how crucial heading structure is for accessibility purposes. For instance, a December 2008 survey of over 1000 screen reader users conducted by WebAIM found that 76% of blind and vision-impaired users ‘always or often’ navigated by headings when they were available. And a May 2012 survey found that 82.1% heading levels were ‘very useful’ or ‘somewhat useful’ when navigating a web page. (This is good, practical research, so take note.)

<snip>

Styling

But it gets worse. Lets say we want to run with a pure HTML5 outline, and we use h1s everywhere. Remember, in the HTML5 spec the h1 is just a generic h element; its real level is determined by how deeply its nested in sectioning elements.

So how do we style it? Well, we could add class names to all our h1 elements so we can pick them out, but that is contrary to the stated HTML5 goal of simplifying authoring; and we may as well stick to h1-h6 (all of which are treated as generic h elements in a HTML5 outline).

Here’s the generic style for an h3 element:

Code: [Select]
article aside nav h1, article aside section h1, 
 article nav aside h1, article nav section h1,
 article section aside h1, article section nav h1, article section section h1,
 aside article nav h1, aside article section h1,
 aside nav article h1, aside nav section h1,
 aside section article h1, aside section nav h1, aside section section h1,
 nav article aside h1, nav article section h1,
 nav aside article h1, nav aside section h1,
 nav section article h1, nav section aside h1, nav section section h1,
 section article aside h1, section article nav h1, section article section h1,
 section aside article h1, section aside nav h1, section aside section h1,
 section nav article h1, section nav aside h1, section nav section h1,
 section section article h1, section section aside h1, section section nav h1, section section section h1 {
    font-size: 1.00em;
 }

Yet that’s what HTML’s structural elements give us. What a mess.

*Meaning not just "eye candy", but good layout and typography that actually makes for easier reading and comprehension.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #22

Oh FFS. This is mental:

QuoteIt’s reasonable to suggest that perhaps user agents in the future, such as browsers and screen readers, will do more with HTML5′s structural elements, and that will make them more palatable to us as authors.

Opera’s Bruce Lawson suggested just that on the WHATWG mailing list in 2009:

    "After all, I know of no user agents that can use time, section, footer, datagrid etc but we mostly expect there to be soon.“

And here’s what Hickson, the HTML5 editor, said in reply:

   " I don’t. Most of the new elements are just meant to make styling easier, so that we don’t have to use classes.“

All that, and the editor doesn’t see user agents ever even using these elements. They are there, he says, to save us from using classes. Put another way, the creator of these elements seems unsure why they’re even in the spec, save ‘making styling easier’.

That is pure idiocy. He obviously hasn't given any thought at all as to how web pages are actually styled. His mindset would lead directly to the CSS abominations quoted in my previous posts. Using the same elements (h1, section, article, whatever) all over pages is EXACTLY when you DO want to assign individual classes for each separate usage. Not doing so makes for horrendously inefficient CSS selectors, and inpenetrable code that is a nightmare to write, debug and to maintain.


ETA: Ha. I like this bloke. :D

QuoteConclusions

Let’s wrap up with some conclusions.

    Headings matter: first, we should really care about the heading structure of our pages to help out blind and vision-impaired users trying to get around with screen readers. The venerable h1-h6 elements may be limited, but they’re relied on heavily by screen reader users.

    HTML5 structure is a mess: we should probably ignore HTML structural elements altogether. They’ve been a bit of a disaster — we have essentially forked the spec, created plenty of broken outlines, and wasted too much time already trying to get our heads around a fundamentally broken system. Long live divs.

    Consider ARIA landmarks: adding ARIA landmarks to your site is another simple, effective way of helping screen reader users.

    Consider schema.org and the future of semantics: schema.org has the backing of the major search engines, and while it’s certainly a mixed bag at the moment, it seems to be future for structured data on the web.

There are lots of good parts in the HTML5 specification, from new forms features to the History API and Canvas implementation. In fact, without the WHATWG, who have been the driving force behind HTML5, we’d still be stuck with HTML4/XHTML 1.0 while we waited for the W3C to get their act together. Nevertheless, just because HTML5 and all the related technology around it is new and exciting, it doesn’t mean we have to accept everything we’re given.

Sometimes it’s worth seeing how the HTML sausage is made, so we know what we’re eating. And in the case of HTML’s structural semantics, I’d rather pass.
Last Edit: June 30, 2013, 07:04:43 am by Antechinus
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #23

Someone find me a huge animated ROFLMAO smiley. I bought this bloke's book (cheap as chips, and worth every cent) and am going through it.

A good example is the new header and footer tags. I did notice that someone has gone and applied these to Elk's index.template.php, in the places where you would expect them. The header tag is up where we have what we'd normally call the header. The footer tag is down at the bottom of every page, where the copyright and stuff is.

Whoever did this probably thought they were being avant garde and terribly semantic. One small problem.

It completely contravenes the HTML5 specifications.

QuoteLet me give you an example.

The spec says <header> and <footer> elements
define areas within a section, but do not define sections themselves, and so won’t
show up in a document outline.

This is something most people get wrong,
including those teaching HTML5 through books and blogs, whose examples
often show <header> being on par with <section>

 The spec also says
<header> and <footer> can be used multiple times per page (once per section,
for example), but you would never pick that up from most HTML5 resources out
there.

These may seem like pedantic, wonkish points. But they illustrate something
very serious—the community is trying to implement HTML5 markup in a way
that doesn’t have much relation to the actual HTML5 spec. It’s a weird inbetween
state of markup limbo that has inadvertently appeared because that’s
what everyone assumed these elements should be used for.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #24

Exactly! :)

I am liking this guy's thoughts as well, it makes totally sense, and reveals stuff that have gone under of the radar of most I suspect. Bought it too, but haven't had time to read it yet(family demanded I dragged myself away from the screen and out into the sunshine. they were hungry you see, and i am the designated barbecue-chief around here 8) )

Re: Semantics, HTML5, and other gruesomeness.

Reply #25

ROFL. Bucketing down rain here. Barbecues are not currently on my agenda, so have read book. :D

It has just confirmed what I had already suspected. The markup examples on the W3C site do not pass my sniff test. They smell bad, but I had assumed that hey, there must be some awesomely justifiable rationale behind them, basically because "ZOMG! HTML5! ZOMG! New! ZOMG! Spexxxxxxxxxx!".

Having done some pretty serious swotting up over the last several days, I can now say that I now thoroughly understand the new specs, at least as they relate to the basic structural markup we need for this project, and that also means I now thoroughly understand why the new specs smell bad.

It's because they are bad. Seriously.

I'm here to give Elk the best markup and CSS that I can write. With that in mind, I have a totally serious proposal to make.

I propose that <header>, <footer>, <nav>, <article>, <aside> and <section> be banned from the Elk repo.

Why? Simple. Using those tags will...

1/ ...do nothing to improve page performance.

2/ ...do nothing to improve SEO. The major search engines have shown very clearly that what they want is Schema.org. They don't care about the new HTML5 tags, any more than they care about meta keywords.

3/ ...do nothing to improve the comprehensibility of either markup or CSS.

4/ ...do nothing to improve accessibility and, in fact, will...

5/ ...actually do a lot to break accessibility. Yes, really.

6/ ...do nothing to improve ease of customisation and , purely because of the convoluted markup they will demand if used according to the specs, and the implications of that, will...

7/ actually make good customisation harder.
Last Edit: June 30, 2013, 07:03:52 pm by Antechinus
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Semantics, HTML5, and other gruesomeness.

Reply #26

 emanuele is tempted to push the "like" button...

NO! Better write it. :+1: (/me thinks we need a :+1: smiley :P)
Bugs creator.
Features destroyer.
Template killer.

Re: Semantics, HTML5, and other gruesomeness.

Reply #27

Quote from: emanuele –
 emanuele is tempted to push the "like" button...

NO! Better write it. :+1: (/me thinks we need a :+1: smiley :P)
yep, agree LOL..
and a thumbsup smiley please..
Thorsten "TE" Eurich
------------------------

Re: Semantics, HTML5, and other gruesomeness.

Reply #28

BTW: I have no idea what I plused to. :P
Bugs creator.
Features destroyer.
Template killer.

Re: Semantics, HTML5, and other gruesomeness.

Reply #29

Been reading on ... Seems using as few as the new HTML5 tags as possible(at least the header/footer/article/section/aside etc. bits) and rather use ARIA for creating a proper ordering for screenreaders, is the way to go. Plus headers of course. Schemas are also useful. And I find the use of canvas interesting, not the least in creating for example flow-charts.

However, after reading more the author thinks javascript will be equally important for adding effects that some of the new tags are supposed to be alternatives for(so stick with JS rather than betting on the tags), meaning using well-tested libraries like JQuery is a  must. (in my case Mootools)

Very interesting!