Home Web Front-end H5 Tutorial HTML5中缩略词标记的重要作用

HTML5中缩略词标记的重要作用

May 17, 2016 am 09:07 AM
html5

       如果你非常精通HTML,看到这个标题,也许你会想起HTML4中的


        HTML5中新增的这个是一个非常有用的标记,但很明显没有被web文档撰写者重视,特别是没有被科技文章编写者重视。为什么这样说呢?不知道你有没有这样的经历,哦,我记起了一篇有趣的文章,《Java程序员的堕落》,强烈推荐你去读一下,但我要说的是,里面列举的那几百个奇怪的缩略词,你认识几个:

Core Java, J2EE, JSP, JDBC, Servlets, AJAX, XML, HTML, XSLT, Web
Services, CSS, JavaScript, SQL, Oracle 10g, MySQL 5.0., JMS,Eclipse,
Adobe Flex Builder 3.x,UML, JDBC, SVN, JUnit, VSS, Jira, HTML, DHTML,
CSS, AJAX, JavaScript, XML, MXML, Action Script, Servlet, JSP, JSTL,
Hibernate 3.x, Spring 2.x, IBatis, SOAP, UDDI, WSDL, Apache Axis, Web
logic Server 8.x, Apache Tomcat 5.0, Struts Framework, MVC, ANT, Maven.
复制代码
Copy after login



我想,如果你能全部解释这些缩略词中每个字母代表的意思,我想你竖起大拇指。我在阅读一些博客时,特别是科技、编程文章时,经常会遇到一些不懂代表什么意思的缩略词,而作者也没有给出任何提示。对很多刚入门的程序员,或很多外行人,我们应该以一种合适的方式让他们知道每个缩略词的意思。


对,方法就是使用标记。


abbr缩略词标记用法


abbr标记的用法跟其它所有的HTML标记用法非常相似。下面是一个例子:

<p>如今<abbr title="是指Model-View-Controller模式">MVC</abbr>模式越
来越被人们诟病,而使用
快速<abbr title="是create, read, update, delete四个词的首字母缩略">CRUD</abbr>生成开发
更是被一些著名程序员唾弃。</p>
Copy after login

把你的缩略词用标记包起来,然后在标记的title属性上指明这个缩略词是从哪几个词缩略而来的,或说明这个简写词的含义。


abbr缩略词标记的效果


这样写会有什么效果呢?能给读者带来哪些好处?下面我们可以来现场体验一下。


如今MVC越来越被更多的人诟病,而使用快速CRUD生成开发更是被一些著名程序员唾弃。
Copy after login

你会看到,缩略词下面是有小点的,而且,将你的鼠标移动到缩略词上,会看到提示,提示信息就是标记上title属性里填写的缩略词解释。太方便了。不是吗。


abbr缩略词标记的美化


如果你使用的是火狐浏览,这种下带小点的装饰是系统自带的。但如果你使用的是谷歌浏览器或IE,这看不到这些小点。你需要在CSS样式表里添加下面一小段样式规则:

abbr[title], acronym[title] {
    border-bottom: 1px dotted;
}
复制代码
Copy after login

  当然,你也可以修改成更漂亮的样式,比如用红色的下划线。


       页面友好性是一个Web应用或web页面成功的重要指标,作为一个Web程序员,我们应该处处注意像缩略词这样的标记在网页中所起的作用,只有当用户感觉到方便时,我们开发出的东西才真正体现出它的价值。

以上就是HTML5中缩略词标记的重要作用的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Statement of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1254
24
Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

See all articles