Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the HTML5 microformats and related attribute names

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces what the HTML5 microformat and related attribute names are like, the content is very detailed, interested friends can refer to, hope to be helpful to you.

On May 29, 2004, on my retired blog and all the lies, when I surveyed the websites of 40 designers to see the conventions they used for public page elements, such as titles and banners, navigation, content and footers (the results at that time).

This is hardly scientific research, but in June of that year, I followed up on some of Eric Meyer's comments and published a naming convention. When I find that a website has passed these naming conventions, I am always happy that I still use it every day, even more than four years later.

At that time, my thoughts could be summed up like this.

The id and class attribute names must reflect the functionality or content of the element, not the introduction. So out of header and then branding; out of footer and then replaced by site-info.

Naming should take on almost an XML style structure. Naming will assume almost the entire XML structure. So, the internal content comes content-main, content-sub and content-supp.

These agreements have served me well, and what I have done has hardly changed their core. There is no doubt that they all make my work faster, more consistent and more beneficial. They make it easier to build products and to train people I work with in my way of thinking. The naming convention works.

Microformat and related attribute names

Let's face it, microformats such as hCard,hCalendar,hAtom and other drafts bring so many property values that it is often not necessary to consider which build file or which hook that constrains the CSS schema. Now I use microformats to such an extent that I don't even use the class attribute (except the class attribute that accompanies the microformat) to evolve the entire page.

On rare occasions, I need to add a new element (assuming a partition for the purpose of the layout). The first thing that comes to mind is what already exists in the extended microformat. I'll give you an example of using the hAtom pattern:

Title

Main content

Related content

If you're keeping the advantage of microformats, you've noticed that entry-related is not part of the hAtom schema, but in this case, I absolutely, definitely have to have an extra factor, how do I make up an attribute value like related-sidelinks?

When does it seem more logical to extend a naming pattern in a microformat?

HTML5

At the beginning of this chapter, I should say frankly that at this moment, I can't pay less attention to HTML5. But that's not the crux of the problem. HTML5 introduces some potentially useful new elements, such as:

Section

A normal part of a file or application. Chapters, in this regard, are a thematic classification of content.

Article

The part of a page consisting of articles that forms a separate part of a document, web page, or website. This could be a forum post, a magazine or newspaper article, a Web log entry, a user-submitted comment, or any other independent item of content. This may be a separate project for forums, magazines, newspaper articles, web logs, user-submitted comments, or any other content.

Aside

The part of a page that consists of content that has nothing to do with the content associated with the aside element and can be considered separate from the content. These parts are often shown as the printing typesetting sidebar.

As it was logical for the inventors of Microformats to base their schemas on existing specifications, surely it now makes sense for me to adapt my naming conventions to follow those in HTML5? Since it is logical for inventors of microformats to develop their patterns on existing specifications, of course, it makes sense for me to follow HTML5 to adapt to my naming convention. Of course, I can't use it yet:

Title

Main content

Related content

But now I can use the id and class property values to help my familiar HTML5, taking my document one step further.

Title

Main content

Related content

I think it's a logical next step for me. So, looking at this demonstration file, I have taken the HTML5 element as the basis for my naming convention. In addition to what I just mentioned, notice that I have identified the way to classify and navigate (nav), build fields with colgroup and col, convert an unordered list into a grid, and use datagrid.

The markup specification for HTML5 also includes details, dialog, and figure, which I can also use as attribute values.

If I can achieve a wish today, it will be that all CSS framework development will adopt the same naming convention (and also widely embedded in microformats), so that beginners of meaningful tags and CSS people have a correct starting point, using more meaningful, more logical, rather than the appearance of id and class attributes.

About the HTML5 microformat and related attribute names are shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report