关于span
来源:互联网 发布:游龙网络有出什么游戏 编辑:程序博客网 时间:2024/06/01 15:25
今天上午发现有个网站是这么用<span>的.点击打开链接
我的疑问是为什么不直接用<p>?
后面发现该内容在English版面中就是直接使用<p>.
那么问题来了:
1.什么时候使用<span>最恰当?
Wiki的定义是,当没有其他html元素能够恰当定义文档内容时.可以使用<span>或<div>并使用class,id,lang,或dir属性来进行调用。
<p>,<em>一类的元素能准确体现html文档的语义,而<span>和<div>则既能提升用户体验,又有助于开发者维护。
In HTML, span
and div
elements are used to define parts of a document so that they are identifiable when no other HTML element is suitable. While other HTML elements such as p
(paragraph), em
(emphasis) and so on accurately represent the semantics of the content, the use of span
and div
leads to better accessibility for readers and easier maintainability for authors. Where no existing HTML element is applicable, span
and div
can valuably represent parts of a document so that HTML attributes such as class
, id
, lang
, or dir
can be applied.[1][2]
2.语义化的含义和意义
来自百度:语义化的网页的好处,最主要的就是对搜索引擎友好,有了良好的结构和语义你的网页内容自然容易被搜索引擎抓取,你网站的推广便可以省下不少的功夫。(wiki的话说 makes it easier for web agents such as search engines and other software to ascertain the significance of the text.)
语义 Web 技术有助于利用基于开放标准的技术,从数据、文档内容或应用代码中分离出意义。
wiki还列举了一个反面例子,就是把<i>当成<em>来用.
正确姿势是emphasize顾名思义用于强调,并可利用CSS修改效果.而italic多用于引用来源(citing resources),引用外来语(foreign phrases or loanwords)
- 关于span
- 关于<span>的属性设置
- 关于Span的flags说明
- span
- span
- span
- SPAN
- Span
- span
- <span>
- span
- span
- span
- 关于android中的一些textview的span
- 关于label和span设置width
- 关于span标签内文字自动换行
- 关于span标签内文字自动换行
- 关于span和input的vertical-align
- Android高性能ORM数据库DBFlow入门教程
- [IDEA学习笔记][keymap]
- Swing鼠标悬停时巧用上下文菜单显示提示信息
- 求1~1000之间的完全数
- 石子归并(GarsiaWachs算法)
- 关于span
- Android通过Wifi来调试你的应用
- [HeadFrist-HTMLCSS学习笔记][第一章Web语言:开始了解HTML]
- Java类库及框架
- 7.3 Android Framework - PropertyAnimation
- Ruby语言基础学习五:Ruby 方法、块
- 两个整数,输出绝对值较大者
- 有序数组的查找
- [HeadFrist-HTMLCSS学习笔记][认识HTML中的“HT”]