欢迎光临
我们一直在努力

HTML语言剖析(4)-网页设计,HTML/CSS

建站超值云服务器,限时71元/月

 

排版标记

<!–注解–><p><br><hr><center><pre><div><nobr><wbr>
<!–注解–>:
像很多电脑语言一样,html 文件亦提供注解功能。浏览器会忽略此标记中的文字(可以 是很多行)而不作显示,一般使用目的:

  • 为文中不同部份加上说明,方便日后修改。
    这对较复杂或非私人网页尤其重要,它不单是提醒自已,亦提醒你的同事这部分 做什么、那部分做什么。
    例子:
    <!–由这处开始是产品订购表格–>

  • 用作版权声明。
    假如你不希望别人使用或复制你的网页,可加上警告字眼。
    例子:
    <!–本文版权为 1998, creation of webpage 所拥有,未经许,请勿抄摘–>
<p> :
<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 doest 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>heres the next paragraph.
显示结果

here is the text for my paragraph. it doest 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.

heres the next paragraph.

<br> :
<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> :
<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> :
<center>称为居中标记。作用:令字、画、表格等显示于中间。

这标记原先是 netscape 所定义,后来其它浏览器都支持它,但你会发现很多标记已有 align=”center” 的参数,<center>似乎多馀了,事实上它还是常用的标记之一,其简单 易用,常用于文字上,对于己加有 align=”center” 参数的 <table> 标记亦要不厌其烦 地加上居中标记,因有狻多浏览器不支持<table> 标记中的 align=”center” 参数。

例子:

原始码 <center>chriss first homepage</center>
<center>whats new</center>
<center>my profile</center>
结果
chriss first homepage

whats new

my profile
<pre> :
<pre>称为预设格式标记。作用:令文件按照原始码的排列方式显示。

这标记允许保留你于原始码中输入的空白及 return。细看以下例子你便可体会到此标记的 威力。除了运用一大堆表格标记之外你只有采用这标记才能有此效果。

能以<pre>标记产生对 效果,或产生多于一行的空白才算上乘!

例子:

原始码
	<pre>	creation of webpage log analysis i

	composer learning  459 407 480 522 547 586 673
	html advanced      200 268 296 358 385 453 506</pre>
显示结果
 		creation of webpage log analysis i	

	composer learning  459 407 480 522 547 586 673
	html advanced      200 268 296 358 385 453 506
<div> :
<div>称为区隔标记。作用:设定字、画、表格等的摆放位置。

<div>应用于 style sheet(式样表)方面会更显威力,它最终目的是给设计者另一种组织 能力,有 class ; style ; title ; id 等属性,将会于【style sheet】一节才作详述,这处只介绍 一个属性设定。
以 <div align=”center”> 为例:

  • align=”center”
    可选值:center ; left ; right 。决定字、画、表格等居中、靠左或靠右。
    <div align=”center”> 的作用和居中标记 <center>一样,前者是由 html3.0 开始 的标准,后者是通用己久的标示法。

例子:

原始码 <div align=”center”>chriss first homepage
<br>whats new
<br>my profile</div>
结果
chriss first homepage
whats new
my profile
<nobr> :
<nobr>称为不折行标记。作用:令某些文字不因太长而绕行,一 显示于同一行或下一 行。它对住址、数学算式、一行数字、程式码等尤为有用。

例子:(其中 chriss creation of webpage 将不被分开而显示于同一行。)

if you want to know how to create you own homepage quickly, dont miss <nobr>chriss creation of webpage</nobr> which will help you a lot.
结果 if you want to know how to create you own homepage quickly, dont miss chriss creation of webpage which will help you a lot.
<wbr> :
<wbr>称为建议折行标记。作用:预设折行部位。
它没有侵犯到 <br> 的责任,只是作建议而已,若观者的系统解像度够高的话,那么它是 不会折行的。

例子:(若不加<wbr>标记,整个网址会显示于下一行。)

原始码 please visit my other homepage which locate at http://www.geocities.com/siliconvalley/<wbr>sector/8234/index.html there are many softwares for download. i think you will really love that place.
结果 please visit my other homepage which locate at http://www.geocities.com/siliconvalley/sector/8234/index.html there are many softwares for download. i think you will really love that place.
赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » HTML语言剖析(4)-网页设计,HTML/CSS
分享到: 更多 (0)

相关推荐

  • 暂无文章