Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I thought one of the main goals of CSS was to separate data from presentation. Isn’t this sneaking presentation back into data?

0
Posted

I thought one of the main goals of CSS was to separate data from presentation. Isn’t this sneaking presentation back into data?

0

A. This is a quite commonly expressed objection to the way microformats uses class, but it’s based on a misunderstanding of the way the class attribute in HTML was designed. Yes, class is very commonly,and appropriately used by web designers in conjunction with CSS to style pages, and in truth, it is often overused for that, but despite this, class, according to the HTML specification “has several roles in HTML”, including “for general purpose processing by user agents”. Microformats utilize this second aspect of the class (and id) attribute, and do so legitimately. It is not an abuse of the class or id attribute to use it to add semantic context to a document. Nor is the use of class in and of itself presentational – in fact, it is an important mechanism for separating presentation from structured content.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123