Good questions!
I did not even realize that there was a microdata format until I read
your e-mail.
I wonder if you could just change your HTML DTD to an HTML5 and go from there?
In other words, change this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
... to this:
<!doctype html>
<html>
From what I know, most HTML4 strict elements should work just fine
under HTML5. You don't need to worry about changing all the tags to
<section> or <header> (for example)... You could do that later, but in
the meantime you could start working with the microdata formats on
specific elements.
Anyway, just a thought. :)
Great questions!
Cheers,
M
Interesting.
This seems pretty official:
But, like you say, it's hardly a community consensus. :(
Purely from a readability perspective, I like that microdata is not
using CSS classes; on the other hand, I'm not keen about pointing
towards a schema (itemtype=) for every little piece of content on my
page. Clearly there are advantages and disadvantages to both
techniques.
On Sat, Jun 9, 2012 at 11:23 AM, Stephen Paul Weber
<singp...@singpolyma.net> wrote:
> Somebody claiming to be Micky Hulse wrote:
>>Purely from a readability perspective, I like that microdata is not
>>using CSS classes
>
> Ah, that's a common misconception. HTML classes have nothing to do with
> CSS. You can style classes with CSS because you can style *many* selectors
> (ids, tag names, and any other attributes) with CSS. The class attribute
> has no more to do with CSS than the tag name or the id or anything else.
> HTML classes provide a mechanism for extending the semantics of the
> document, which many microformats make use of (along with other useful HTML
> semantics such as the href attribute of <a> tags, etc).
Thanks for the clarification, I really appreciate it.
I should have clarified... I don't mind that microformats use CSS
classes, I just think my HTML looks a tad more readable when using
microdata. For example:
<https://gist.github.com/2898578>
(Sorry that the HTML is different)
Maybe that's not the best example, but my gut feeling is that I prefer
the microdata because it's not using the class attributes. Of course,
my opinion is based on personal preference. For example:
<div class="sig vcard">
vs.
<div class="sig" itemscope itemtype="http://schema.org/Person">
Clearly the microdata is more markup, but I like that the "data
format" has bee separated from the class attribute.
Going back to the microdata FAQ:
"...reuse of the class tag can cause conflicts with website CSS."
I think they make a good point there.
...
I've read about microformats on/off for years now (I even bought the
Microformat book when it first came out), and I am new to microdata
(just digging my teeth into it now)... I'm keeping an open mind, but
there's something in my gut that wants to go with microdata over
microformats.
On the other hand, who's to say one can't use both? Right?
O.K., crawling back into my hole now. Sorry if I hijacked this thread. :(
Thanks again Stephen!
Cheers!
Micky
On Sat, Jun 9, 2012 at 3:13 PM, Stephen Paul Weber
<singp...@singpolyma.net> wrote:
> Sorry, just going to point out again (pet peeve of mine), there are no "CSS
> classes", only "HTML classes". :P
Doh! Sorry, I did not catch that the first time. :(
My tendency is to say CSS classes when referring to the values of the
"class" attribute of an html tag; I think that's why I call it a class
- I am referring to the value(s) of the HTML class attribute. Lol,
sorry for my ignorance if I used the wrong term(s).
> The class attribute is itself a "data format", encoding types that the
> element matches. The fact that people happen to style classes with CSS is
> sort of irrelevant: if I used microdata I would style microdata attributes
> using CSS as well.
I hear what you are saying and that's a good observation.
I think we're talking about two different things here. :D
I agree and understand everything you have said.
With that said, I don't think that there's anything wrong with me not
liking the fact that microformats use HTML classes. For me, simply
put, it's more about clutter and readability. Based on my few tests
within the last couple days, microdata just seems more clean.
Again, what the heck do I know... I'm open minded... I think I need to
spend some more time playing with the two formats. :)
>>Going back to the microdata FAQ:
>>"...reuse of the class tag can cause conflicts with website CSS."
>>I think they make a good point there.
>
> Only if you somehow (a) can't change your CSS and (b) never style with
> anything other than classes. Like I said above: I would use CSS on
> itemprop/itemtype as well, in which case their use affects my styles as
> well.
Interesting! I don't think I would style itemprop/itemtype... I guess
I'm oldschool like that. :D
About not being able to change your CSS: I think it depends on the
situation/context. At my current job, I work with around 20 third
party companies where my CSS and HTML templates are hosted on their
servers and mixed-in with their CSS and HTML; based on my experience,
it's best for me to namespace my CSS classes to avoid style conflicts.
With 100% of these third party companies, there's always some amount
of their CSS that I can't touch.
>>(I even bought the
>>Microformat book when it first came out)
> There's a book? That's weird...
I know, right! :D
"Microformats: the book"
<http://microformats.org/2007/04/19/microformats-the-book>
>>On the other hand, who's to say one can't use both? Right?
> Sure, you can definitely use both.
> So, in the end it's your own choice, I'll just outline breifly why I prefer
> microformats:
Those are very good reasons to use microformats. I'm going to let this
all sink in and experiment with both.
Thanks so much for your pro tips and advice Stephen, I really appreciate it.
Also, sorry to the original poster for my hijacking of the thread. :(
Have a nice day all!
Cheers,
Micky