认识XHTML

XHTML   代码规范
1.所有的标记都必须有一个相应的结束标记
2.所有标签的元素和属性的名字都必须使用小写
3.所有的标记都必须合理嵌套
4.所有的属性必须用引号括起来
5.特殊符号“<”、“>”和“&”用编码表示
6.每个属性必须赋值
7.不要在注释内容中使用“--”

*默认创建的网页文档虽仍然以html为文档的拓展名,但事实上都是以XHTML编写的。

XHTML 基本结构

<!DocType>  ————不可少,必须放在XHTML文档的最顶部
<html>
<head>
     <title></title>
</head>
<body>
</body>
</html>

根元素——<html></html>
命名空间——xmlns(XHTML namespace)命名空间  
<html xmlns="http://www.w3.org/1999/xhtml">


1.文档标记
注释<!-- 注释的内容 -->

2.强制换行 文字<br/>
不换行    <nobr>文字</nobr>

3.特殊字符   

4.段落标记 <p></p>

5.标题文字标记  <h1> <h2> <h3> <h4> <h5> <h6>

6.水平线标记 <hr />

7.特殊文字样式标记
<em></em>   强调文本,显示为倾斜
<strong></strong> 进一步强调,显示为粗体
<sup></sup> 作为上标样式显示
<sub></sub> 作为下标样式显示

8.原样显示文本标记
<pre>文本</pre>
中间不能包含<img> <big> <small> <sub> <sup>等标记

9.超链接 <a>

10.图像标记 <img>
11.列表 
无序列表
<ul type="符号类型 ">
     <li>第一个列表项</li>
     <li>第二个列表项</li>
</ul>
type=disc     实心圆
type=circle   空心圆
type=square 方框

 有序列表标记
<ol type="符号类型 ">
     <li>第一个列表项</li>
     <li>第二个列表项</li>
</ol>
type=1
type=a
type=A
type=I
type=i

11.表格 
<table>
     <caption>表格的标题</caption>
     <thead>
     <tr>
           <th>表头1</th>
            <th>表头2</th>
     </tr>
    </thead>
     <tbody>
     <tr>           
             <td>一般单元格1</td>
             <td>一般单元格2</td>
     </tr>
     </tbody>
</table>

12.字幕 <marquee></marquee>

13.音频 
     点播:<a href="music.mid">三只小熊</a>  点击即可听到音乐
     内嵌:<embed>
     IE中的背景音乐:<bgsound src="music.mid" loop="2"/>

14.视频
     链接视频文件: <a href="shipin.avi">视频1</a> 
    内嵌:<embed>
    
15.表单
<from action="" method="get||post">
     <fieldset>
          <legend>登录表单</legend>
          <p><lable for="name">账号:</lable><input type="text" id="name"></p>
          <p><lable for="pw">密码:</lable><input type="text" id="name"></p>
     </fieldset>
</from>

<input type="text">
<input type="password">
<input type="reset">
<input type="submit">

checkbox

radio

select

<textarea></textarea>


16.框架(多窗口页面)
<frameset rows="87,*" framespacing="0" border="0">
    <frame src="top.html" id="header-frame" name="header-frame" frameborder="no" scrolling="no">
    <frameset cols="216, 10, *" framespacing="0" border="0" id="frame-body">
        <frame src="menu.html" id="menu-frame" name="menu-frame" frameborder="no" scrolling="yes">
        <frame src="drag.html" id="drag-frame" name="drag-frame" frameborder="no" scrolling="no">
        <frame src="main.html" id="main-frame" name="main-frame" frameborder="no" scrolling="yes">
    </frameset>
</frameset>
<noframes></noframes>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值