search
HomeWeb Front-endH5 TutorialHTML5 microformats and related attribute names_html5 tutorial tips

On May 29, 2004, after I retired the blog and all the talk, I surveyed 40 designers on their websites to see what conventions they used for common page elements such as headers and banners, navigation, content, and Footer (result from that time).

This was hardly a scientific study, but in June of that year I followed up on some of Eric Meyer's comments and published a set of naming conventions. I'm always happy when I find a website that has adopted these naming conventions and I still use it every day, even more than 4 years later.

My thoughts at that time can be summarized as follows

The id and class attribute names must reflect the function or content of the element, not the presentation. So the header was removed and branding was introduced; the footer was removed and replaced by site-info.

Naming should take on almost an XML style structure. Naming should take on almost an XML style structure. So, inside content comes content-main , content-sub and content-supp .

These conventions have served me well, and what I've done has barely changed their core. Without a doubt, they all make my work faster, more consistent and more beneficial. They make it easier to build products and educate the people I work with in my way of thinking. The naming convention works.

Microformats and related attribute names

Let’s face it, microformats like hCard, hCalendar, hAtom and other drafts bring so many attribute values ​​to the table There is often no need to consider which build file or which constraint CSS pattern hooks are provided for these further property values. Now I use microformats to such an extent that I develop the entire page without even using the class attribute (other than the class attribute that comes with microformats).

On the rare occasion that I need to add a new element (assuming a division for layout purposes) my first thought is to extend the microformat that already exists. I'll give you an example of using hAtom mode:



Title




Main content



Related content


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 pattern, but in this case I absolutely, definitely had to have an extra factor of how it was composed What about an attribute value like related-sidelinks?

When does it seem more logical to extend the naming pattern of microformats?

HTML5

At the beginning of this chapter, I should frankly say that at this moment, I cannot pay less attention to HTML5. However, this is not the crux of the matter. HTML5 introduces some potentially very useful new elements, such as:

section

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

article

A portion of a page consisting of articles that form an independent 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. , or any other independent item of content.

aside

A part of a page that consists of content that is independent of the content associated with the aside element and can be considered separate from the content. These sections often appear as typographic sidebars.

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? It's logical for some specs to evolve their patterns, surely, and now it makes sense for me to follow HTML5 by adapting my naming conventions? Of course, I can’t use it yet:



Title




Main content




Title

Main content



Title




Main content



Related content


Related content

But now I can use the id and class attribute values ​​to help me get familiar with HTML5, taking my documents one step closer to it.

Title

Main content
Related content
I feel like it’s a logical next step for me. So, take a look at this sample document where I've taken HTML5 elements as the basis for my naming convention. In addition to what I just mentioned, note that I have determined the way of classification and navigation (nav), used colgroup and col to build fields, converted an unordered list into a grid, and used datagrid. HTML5 tag specifications also include details, dialog and figure, which I can also use as attribute values. If I could grant one wish today, it would be that all CSS framework developers would adopt the same naming convention (and also embed microformats extensively) so that people new to meaningful markup and CSS would have the right The starting point is to use more meaningful and logical attributes instead of the superficial id and class attributes.
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Is H5 a Shorthand for HTML5? Exploring the DetailsIs H5 a Shorthand for HTML5? Exploring the DetailsApr 14, 2025 am 12:05 AM

H5 is not just the abbreviation of HTML5, it represents a wider modern web development technology ecosystem: 1. H5 includes HTML5, CSS3, JavaScript and related APIs and technologies; 2. It provides a richer, interactive and smooth user experience, and can run seamlessly on multiple devices; 3. Using the H5 technology stack, you can create responsive web pages and complex interactive functions.

H5 and HTML5: Commonly Used Terms in Web DevelopmentH5 and HTML5: Commonly Used Terms in Web DevelopmentApr 13, 2025 am 12:01 AM

H5 and HTML5 refer to the same thing, namely HTML5. HTML5 is the fifth version of HTML, bringing new features such as semantic tags, multimedia support, canvas and graphics, offline storage and local storage, improving the expressiveness and interactivity of web pages.

What Does H5 Refer To? Exploring the ContextWhat Does H5 Refer To? Exploring the ContextApr 12, 2025 am 12:03 AM

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

H5: Tools, Frameworks, and Best PracticesH5: Tools, Frameworks, and Best PracticesApr 11, 2025 am 12:11 AM

The tools and frameworks that need to be mastered in H5 development include Vue.js, React and Webpack. 1.Vue.js is suitable for building user interfaces and supports component development. 2.React optimizes page rendering through virtual DOM, suitable for complex applications. 3.Webpack is used for module packaging and optimize resource loading.

The Legacy of HTML5: Understanding H5 in the PresentThe Legacy of HTML5: Understanding H5 in the PresentApr 10, 2025 am 09:28 AM

HTML5hassignificantlytransformedwebdevelopmentbyintroducingsemanticelements,enhancingmultimediasupport,andimprovingperformance.1)ItmadewebsitesmoreaccessibleandSEO-friendlywithsemanticelementslike,,and.2)HTML5introducednativeandtags,eliminatingthenee

H5 Code: Accessibility and Semantic HTMLH5 Code: Accessibility and Semantic HTMLApr 09, 2025 am 12:05 AM

H5 improves web page accessibility and SEO effects through semantic elements and ARIA attributes. 1. Use, etc. to organize the content structure and improve SEO. 2. ARIA attributes such as aria-label enhance accessibility, and assistive technology users can use web pages smoothly.

Is h5 same as HTML5?Is h5 same as HTML5?Apr 08, 2025 am 12:16 AM

"h5" and "HTML5" are the same in most cases, but they may have different meanings in certain specific scenarios. 1. "HTML5" is a W3C-defined standard that contains new tags and APIs. 2. "h5" is usually the abbreviation of HTML5, but in mobile development, it may refer to a framework based on HTML5. Understanding these differences helps to use these terms accurately in your project.

What is the function of H5?What is the function of H5?Apr 07, 2025 am 12:10 AM

H5, or HTML5, is the fifth version of HTML. It provides developers with a stronger tool set, making it easier to create complex web applications. The core functions of H5 include: 1) elements that allow drawing graphics and animations on web pages; 2) semantic tags such as, etc. to make the web page structure clear and conducive to SEO optimization; 3) new APIs such as GeolocationAPI support location-based services; 4) Cross-browser compatibility needs to be ensured through compatibility testing and Polyfill library.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools