第七章 标记文字

2016-12-21 10:00:45来源:oschina作者:gtandsn人点击

第七城市

一、超链接


1、生成超链接:


用a元素生成:http://www.w3school.com.cn/tags/tag_a.asp


2、生成指向外部的超链接:浏览器支持的协议,http,https,ftp等


从一个文档到另一个文档





Example






I like apples and
oranges.

3、使用相对URL:默认相对的路径是当前路径,可以通过base元素改变





Example






I like apples and
oranges.
You can see other fruits I like here.

4、生成内部超链接


定位到同一文档中的某一个元素


通过id定位,如果id找不到就找name.





Example





I like apples and
oranges.
You can see other fruits I like here.


I also like bananas, mangoes, cherries, apricots, plums, peaches and grapes.



5、设定浏览环境:在什么地方显示文档


_bank,_self,_top,等

二、用基本的文字元素标记内容


1、表示关键词和产品名称


b:http://www.w3school.com.cn/tags/tag_b.asp





Example







I like apples and oranges.

2、加以强调


em:http://www.w3school.com.cn/tags/tag_phrase_elements.asp





Example







I like apples and oranges.

3、表示外文词语和科技术语


i:http://www.w3school.com.cn/tags/tag_i.asp


I like apples and oranges.
My favorite kind of orange is the mandarin, properly known
as citrus reticulata.

4、表示不准确或校正


s:http://www.w3school.com.cn/tags/tag_s.asp


I like apples and oranges.
My favorite kind of orange is the mandarin, properly known
as citrus reticulata.
Oranges at my local store cost $1 each $2 for 3.

5、表示重要文字


strong:http://www.w3school.com.cn/tags/tag_phrase_elements.asp


I like apples and oranges.
Warning: Eating too many oranges can give you heart burn.

6、为文字添加下划线


u:http://www.w3school.com.cn/tags/tag_u.asp


I like apples and oranges.
Warning: Eating too many oranges can give you heart burn.

7、添加小号字体内容(免责声明和澄清声明)


small:http://www.w3school.com.cn/tags/tag_small.asp


Oranges at my local store are $1 each (plus tax)

8、添加上标下标


sub:下标http://www.w3school.com.cn/tags/tag_sub.asp


sup:上标:http://www.w3school.com.cn/tags/tag_sup.asp


The point x10 is the 10th point.

三、换行(br,wbr)


1、br:用在换行也是内容的一部分http://www.w3school.com.cn/html5/html5_br.asp


I WANDERED lonely as a cloud
That floats on high o'er vales and hills,
When all at once I saw a crowd,
A host, of golden daffodils;
I WANDERED lonely as a cloud

That floats on high o'er vales and hills,

When all at once I saw a crowd,
A host, of golden daffodils;

2、wbr:html5新增:表示长度超过浏览器窗口的内容适合在此换行,由浏览器决定。


告诉浏览器一个单词最适合在什么地方拆分。


This is a very long word: Supercalifragilisticexpialidocious.
We can help the browser display long words with the wbr element. This is a very long word: Supercalifragilisticexpialidocious.
We can help the browser display long words with the wbr element.

四、输入输出


code,var samp,kbd http://www.w3school.com.cn/tags/tag_phrase_elements.asp



var fruits = ["apples", "oranges", "mangoes", "cherries"];
document.writeln("I like " + fruits.length + " fruits");


The variable in this example is fruits


The output from the code is: I like 4 fruits


When prompted for my favorite fruit, I typed: cherries

五、标题引用,引文,定义和缩写----在科学和学术领域的文章中经常使用


1、缩写--abbr:title表示该缩写代表的完整词语


I like apples and oranges.
The FDOC regulates the Florida
citrus industry.

2、定义术语--dfn


The apple is the pomaceous fruit of the apple tree,
species Malus domestica in the rose family.

3、引用---q:表示引自他处的内容



The
apple is the pomaceous fruit of the apple tree,
species Malus domestica in the rose family.


4、引用其它作品的标题---cite


My favorite book on fruit is Fruit: Edible, Inedible, Incredible
by Stuppy & Kesseler

六、使用语言元素---对非西方语言进行支持


1、注音符号(ruby,rt,rp):帮助读者掌握表意语言文字正确发音的符号



Oranges are often made
into OJ (Orange Juice)


2、改变文字朝向(bdo)--必须加上dir属性,(rtl,ltr)



This is left-to-right: I like oranges



This is right-to-left: I like oranges


3、想要显示内容的文字方向未知的情况(bdi)---浏览器会自动确定文字方向,可能搅乱页面布局


七、其他文档元素


1、span--表示一段一般性的内容,本身没有任何含义,可以用来把一些全局属性应用到一段内容上




Example






I like apples and oranges.


2、突出显示文本---mark:用来表示因为与某段上下文相关联而被突出显示的一段文字


Homophones are words which are pronounced the same, but have different spellings
and meanings. For example:


I would like a pair of pears


3、表示增加和删除内容(ins,del)


两个局部属性:cite,datetime


Homophones are words which are pronounced the same, but have different spellings
and meanings. For example:


I would like a pair of pears



I can sea the see
I can see the sea


4、时间和日期time


I still remember the best apple I ever tasted.
I bought it at
on .
第七城市

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台