


[Html Css] css naming convention, html tag semantics_html/css_WEB-ITnose
<!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>css命名规范、html标签语义化</title> <style> dl,li { font: 12px/24px 'simsun';} dl dt { font-weight: bold; } </style></head><body><div class="link"> <a href="http://www.html5jscss.com/html5-semantics-section-30.html">本文参考文章1</a> <a href="http://www.html5jscss.com/html5-semantics-rich-60.html">本文参考文章2</a></div><section> <h1>命名规范</h1> <article> <ol> <li>命名只能是[a-zA-Z0-9]、连字符(-)、下划线(_)</li> <li>命名必须以字母开头命名、单词间用下换线(main_left)连接或驼峰命名(mainLeft、MainLeft)</li> <li>语义化命名{侧边栏:sidebar,主要内容:main}</li> </ol> </article></section><section> <h1>html标签语义化</h1> <article> <dl> <dt>header元素</dt> <dd>描述:“网页”或“section”的页头,一般包括h1-h6、hgroup、nav、logo相关等。</dd> <dd>注意:没有个数限制,如果hgroup或h1-h6自己就能工作的很好,那就不要用header。</dd> <dd>示例:header>hgroup>h1+h2</dd> </dl> <dl> <dt>footer元素</dt> <dd>描述:“网页”或“section”的页脚,一般包括版权等。</dd> <dd>注意:没有个数限制。</dd> <dd>示例:footer{copyright©2013}</dd> </dl> <dl> <dt>hgroup元素</dt> <dd>描述:“网页”或“section”的标题,或组合h1-h6。</dd> <dd>注意:连续多个h1-h6标签需要用hgroup,只有一个h1-h6不需要hgroup,</dd> <dd>示例:hgroup>h1+h2</dd> </dl> <dl> <dt>nav元素</dt> <dd>描述:定义主导航。</dd> <dd>注意:除主导航外不建议使用。</dd> <dd>示例:nav>ol>li{menu$}*3</dd> </dl> <dl> <dt>aside元素</dt> <dd>描述:在article内表示主要内容的附属信息,在article外常用于侧边栏。</dd> <dd>示例:section>article+aside</dd> </dl> <dl> <dt>section元素</dt> <dd>描述:代表文档中一个分组或分段。</dd> <dd>注意:通常需要包含标题,可以用nav、article等的就不要用section,没有实际意义就用div。</dd> <dd>示例:section>h1+article</dd> </dl> <dl> <dt>article元素</dt> <dd>描述:代表在页面或网站中自成一体的内容,为了独立开发或重用;例如论坛帖子,博客文章。</dd> <dd>注意:通常需要包含标题。</dd> <dd>示例:section>h1+article*2>h2{独立$}</dd> </dl> <dl> <dt>address元素</dt> <dd>描述:常用语联系信息,邮编地址等。</dd> <dd>示例:address>ul>li{地址$}*2 </dd> </dl> <dl> <dt>h1-h6元素</dt> <dd>描述:标题。</dd> <dd>注意:因为hgroup、section、article的出现,允许一个页面里出现多次h1。</dd> <dd>示例:section>h1{section标题}+article>h1{article标题}</dd> </dl> <dl> <dt>div元素</dt> <dd>描述:一个区块,没有语义。</dd> </dl> <dl> <dt>dl元素</dt> <dd>描述:自定义列表,与dt、dd组合使用。</dd> <dd>注意:常用于名词解释,描述。</dd> </dl> <dl> <dt>ol元素</dt> <dd>描述:有序列表,与li组合使用。</dd> </dl> <dl> <dt>ul元素</dt> <dd>描述:无序列表,与li组合使用。</dd> </dl> <dl> <dt>time元素</dt> <dd>描述:定义发布时间。</dd> <dd>注意:time包括记起识别时间戳属性(datetime="2012-12-25"),pubdata标记(pubdata="true")属性,文本内容</dd> </dl> <dl> <dt>a元素(anchor 的缩写)</dt> <dd>描述:定义超链接。</dd> </dl> <dl> <dt>em元素(emphasis 的缩写)</dt> <dd>描述:句意强调或局部强调,改变局部侧重点。</dd> </dl> <dl> <dt>strong元素</dt> <dd>描述:表示重要,凸显关键语句。</dd> </dl> <dl> <dt>p元素</dt> <dd>描述:定义段落。</dd> </dl> <dl> <dt>b元素(bold 的缩写)</dt> <dd>描述:表示加粗,突出显示,无强调作用,常用于文档概要,评论中的关键字。</dd> </dl> <dl> <dt>i元素(italic 的缩写)</dt> <dd>描述:表示倾斜或不同于文章观点的文本,类似于话外音。</dd> </dl> <dl> <dt>code元素</dt> <dd>描述:定义计算机代码文本。</dd> </dl> <dl> <dt>q元素(quote 的缩写)</dt> <dd>描述:定义短的引用内容。</dd> </dl> <dl> <dt>blockquote元素</dt> <dd>描述:定义长的引用内容。</dd> </dl> <dl> <dt>cite元素</dt> <dd>描述:定义引用内容标题。</dd> </dl> <dl> <dt>u元素(underline 的缩写)</dt> <dd>描述:定义下划线。</dd> </dl> <dl> <dt>abbr元素(abbreviation 的缩写)</dt> <dd>描述:定义一个缩写文本,建议在abbr的title中填写全称。</dd> </dl> <dl> <dt>dfn元素(defining instance 的缩写)</dt> <dd>描述:定义一个术语。</dd> </dl> <dl> <dt>var元素</dt> <dd>描述:定义计算机代码中的变量。</dd> </dl> <dl> <dt>samp元素(sample 的缩写)</dt> <dd>描述:由程序输出的示例文本。</dd> </dl> <dl> <dt>kbd元素(keyboard 的缩写)</dt> <dd>描述:由键盘输入文本。</dd> </dl> <dl> <dt>wbr元素(word break 的缩写)</dt> <dd>描述:定义换行的时机。</dd> </dl> <dl> <dt>span元素</dt> <dd>描述:一个行内元素区域,没有语义。</dd> </dl> <dl> <dt>br元素</dt> <dd>描述:定义一个换行。</dd> </dl> <dl> <dt>pre元素</dt> <dd>描述:预格式化文本,会保留空格和换行。</dd> </dl> <dl> <dt>hr元素</dt> <dd>描述:分割线。</dd> </dl> <dl> <dt>figure元素</dt> <dd>描述:一块独立的内容,该内容被移除不会影响周围内容,常用于统计,图,音频、视频、代码片段等。</dd> </dl> <dl> <dt>figcaption元素</dt> <dd>描述:当figure需要一个标题时,用且只能用figcaption定义。</dd> </dl> <dl> <dt>img元素</dt> <dd>描述:引入一张图片。</dd> </dl> <dl> <dt>iframe元素</dt> <dd>描述:引入一张网页。</dd> </dl> <dl> <dt>canvas元素</dt> <dd>描述:用于绘画。</dd> </dl> <dl> <dt>video元素</dt> <dd>描述:引入视频。</dd> </dl> <dl> <dt>audio元素</dt> <dd>描述:引入音频。</dd> </dl> </article></section></body></html>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex
