您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

HTML语言剖析之排版标记

2025/9/29 23:26:30发布18次查看
<!--注解--> ; <p> ; <br> ; <hr> ; <center> ; <pre> ; <div> ; <nobr> ; <wbr> ; 
■<!--注解-->: ▲top
像很多电脑语言一样,html 文件亦提供注解功能。浏览器会忽略此标记中的文字(可以 是很多行)而不作显示,一般使用目的: 
为文中不同部份加上说明,方便日后修改。 
这对较复杂或非私人网页尤其重要,它不单是提醒自已,亦提醒你的同事这部分 做什么、那部分做什么。 
例子: 
<!--由这处开始是产品订购表格-->
用作版权声明。 
假如你不希望别人使用或复制你的网页,可加上警告字眼。 
例子: 
<!--本文版权为 1998, creation of webpage 所拥有,未经许,请勿抄摘-->
■ <p> : ▲top
<p>称为段落标记。作用:为字、画、表格等之间留一空白行。 
本来<p>是一围堵标记,标于一段落的头尾,但从 html 2.0 开始己不需要</p>作结尾。
<p> 的常用参数: 如:<p align="center">
align=center 
可选值:right, left, center。 
内定值: align=left 
例子: 原始码 here is the text for my paragraph. it does't matter how long it is, 
how many space are between the words or when i decide to hit the return key. 
it will create a new paragraph only when i begin the tag with another one. 
<p>here's the next paragraph. 
显示结果 here is the text for my paragraph. it does't matter how long it is, how many space are between the words or when i decide to hit the return key. it will create a new paragraph only when i begin the tag with another one. 
here's the next paragraph.
■ <br> : ▲top
<br>称为换行标记。作用:令字、画、表格等显示于下一行。 
由于浏览器会自动忽略原始码中空白和换行的部分,这令到<br>成为最常用的标记之 一。因为无论你在原始码中编好了多漂亮的文章,若不适当地加上换行标记或段落标记, 浏览器只会将它显示成一大段。
错误示范:(邮局可不会接受一行过的地址) 原始码 566 e boston post rd 
mamaroneck ny 10543-9982 
united states of america 
结果 566 e boston post rd mamaroneck ny 10543-9982 united states of america
正确例子: 原始码 566 e boston post rd 
<br>mamaroneck ny 10543-9982 
<br>united states of america 
结果 566 e boston post rd 
mamaroneck ny 10543-9982 
united states of america
■ <hr> : ▲top
<hr>称为水平线。作用:插入一条水平线。 
<hr> 之参数修改: 
以: <hr align="left" size="2" width="70%" color="#0000ff" noshade> 为例。
align=left 
设定线条置放位置,可选择:left;right;center 三种设定值。
size=2 
设定线条厚度,以像素作单位,内定为 2。
width=70% 
设定线条长度,可以是绝对值(以像素作单位)或相对值,内定为 100%。
color=#0000ff 『只适用于ie』 
设定线条颜色,内定为黑色。 #0000ff 代表蓝色,亦可以采用颜色的名称,即 text=blue 。
noshade 
设定线条为平面显示,若删去则具阴影或立体,这是内定值。 
例子: 原始码 <hr> 
<hr align="left" size="4"> 
<hr align="left" size="2" width="70%" color="#0000ff" noshade> 
<hr align="left" size="4" width="70" color="#008000"> 
显示结果 
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
■ <center> : ▲top
<center>称为居中标记。作用:令字、画、表格等显示于中间。 
这标记原先是 netscape 所定义,后来其它浏览器都支持它,但你会发现很多标记已有 align=center 的参数,<center>似乎多馀了,事实上它还是常用的标记之一,其简单 易用,常用于文字上,对于己加有 align=center 参数的 <table> 标记亦要不厌其烦 地加上居中标记,因有狻多浏览器不支持<table> 标记中的 align=center 参数。
例子: 原始码 <center>chris's first homepage</center> 
<center>what's new</center> 
<center>my profile</center> 
结果 chris's first homepage 
what's new 
my profile
■ <pre> : ▲top
<pre>称为预设格式标记。作用:令文件按照原始码的排列方式显示。 
这标记允许保留你于原始码中输入的空白及 return。细看以下例子你便可体会到此标记的 威力。除了运用一大堆表格标记之外你只有采用这标记才能有此效果。
能以<pre>标记产生对 效果,或产生多于一行的空白才算上乘!
以上就是html语言剖析之排版标记的内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product