html 无序列表_有序列表_框架

HTML不区分大小写,但最好统一。


练习题:课程表

<th>定义表头

<th>和<td>从本质上是没有区别的,但是用了<th>会自动的加粗体

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body>  
  4.         <center>成绩表</center>  
  5.         <br/>  
  6.         <!--表格-->  
  7.         <table border="3px" align="center" width="600px" bordercolor="579AFE">  
  8.             <tr align="center">  
  9.                 <th>项目</th>  
  10.                 <th colspan="5">上课</th>  
  11.                 <th colspan="2">休息</th>  
  12.             </tr>  
  13.             <tr align="center">  
  14.                 <th>星期</th>  
  15.                 <th>星期一</th>  
  16.                 <th>星期二</th>  
  17.                 <th>星期三</th>  
  18.                 <th>星期四</th>  
  19.                 <th>星期五</th>  
  20.                 <th>星期六</th>  
  21.                 <th>星期日</th>  
  22.             </tr>  
  23.             <tr align="center">  
  24.                 <td rowspan="4">上午</td>  
  25.                 <td>语文</td>  
  26.                 <td>数学</td>  
  27.                 <td>英语</td>  
  28.                 <td>英语</td>  
  29.                 <td>物理</td>  
  30.                 <td>计算机</td>  
  31.                 <td rowspan="4">休息</td>  
  32.             </tr>  
  33.             <tr align="center">  
  34.                 <td>数学</td>  
  35.                 <td>数学</td>  
  36.                 <td>地理</td>  
  37.                 <td>历史</td>  
  38.                 <td>化学</td>  
  39.                 <td>计算机</td>  
  40.             </tr>  
  41.             <tr align="center">  
  42.                 <td>化学</td>  
  43.                 <td>语文</td>  
  44.                 <td>体育</td>  
  45.                 <td>计算机</td>  
  46.                 <td>英语</td>  
  47.                 <td>计算机</td>  
  48.             </tr>  
  49.             <tr align="center">  
  50.                 <td>政治</td>  
  51.                 <td>英语</td>  
  52.                 <td>体育</td>  
  53.                 <td>历史</td>  
  54.                 <td>地理</td>  
  55.                 <td>计算机</td>  
  56.             </tr>  
  57.             <tr align="center">  
  58.                 <td rowspan="2">下午</td>  
  59.                 <td>语文</td>  
  60.                 <td>数学</td>  
  61.                 <td>英语</td>  
  62.                 <td>英语</td>  
  63.                 <td>物理</td>  
  64.                 <td>计算机</td>  
  65.                 <td rowspan="2">休息</td>  
  66.             </tr>  
  67.             <tr align="center">  
  68.                 <td>数学</td>  
  69.                 <td>数学</td>  
  70.                 <td>地理</td>  
  71.                 <td>历史</td>  
  72.                 <td>化学</td>  
  73.                 <td>计算机</td>  
  74.             </tr>  
  75.         </table>  
  76.     </body>  
  77. </html>  


经验: 为了提高开发效率,把帮助手册,还有index.html的帮助文档首页都弄到快速启动栏里,这样就不用临时去翻动文件夹了,节省时间。


html列表--无序列表
<ul type="属性值">
<li>列表内容</li>

</ul>


<ul>的属性设定(常用):例如<ul type="square">
type="square"

设定符号款式,其值有三种,如下,默认为type="disc";
html的元素参考 html语言教程(html版)
type="disc"时的列项符号为实心圆点
type="circle"时的列项符号为空心圆
type="square"时的列项符号为空心正方形


ul用的很多,新浪搜狐首页面大量使用ul来显示数据,搜索引擎很喜欢ul


[html]  view plain copy
  1. <html>  
  2.     <head>  
  3.         <title></title>  
  4.     </head>  
  5.     <body>  
  6.         <ul>  
  7.             <li>英雄</li>  
  8.             <li>精武门</li>  
  9.             <li>西游记</li>  
  10.         </ul>  
  11.         <br/>  
  12.         <ul type="square">  
  13.             <li>英雄</li>  
  14.             <li>精武门</li>  
  15.             <li>西游记</li>  
  16.         </ul>  
  17.         <br/>  
  18.         <ul type="circle">  
  19.             <li>英雄</li>  
  20.             <li>精武门</li>  
  21.             <li>西游记</li>  
  22.         </ul>  
  23.     </body>  
  24. </html>  


html有序列表
<ol type="属性值" start="起始值">
<li>内容</li>
</ol>

<ol>称为顺序列表标记。<li>则用以标记列表项目。所谓顺序列表就是每一项有顺序,又称编号列表。
<ol>的属性设定(常用):
例如:<ol type="i" start="4"></ol>
设定开始数目,不论设定了哪一数目款式,其值只能是1,2,3……等整数,默认为start="1"。
i可以取以下值中的任意一个:
1阿拉伯数字1,2,3……
a小写字母a,b,c……
A大写字母A,B,C……
i小写罗马字母i,ii,iii……
I大写罗马数字I,II,III……


[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body>  
  4.         <ol>  
  5.             <li>宋江</li>  
  6.             <li>卢俊义</li>  
  7.             <li>吴用</li>  
  8.         </ol>  
  9.         <br/>  
  10.         <ol type="i">  
  11.             <li>宋江</li>  
  12.             <li>卢俊义</li>  
  13.             <li>吴用</li>  
  14.             <li>林冲</li>  
  15.         </ol>  
  16.         <br/>  
  17.         <ol type="A" start="3">  
  18.             <li>宋江</li>  
  19.             <li>卢俊义</li>  
  20.             <li>吴用</li>  
  21.             <li>林冲</li>  
  22.         </ol>  
  23.     </body>  
  24. </html>  


html框架
用途主要是用于分割显示多个页面
<frameset frameborder="边框大小" cols="横向各窗口百分比,隔开" rows="纵向各窗口百分比"
<frame name="给frame取名" src="html路径" noresize>
</frameset>


注意: 如果a.html包括了其它的页面(framsset)则要求a.html本身不能有body体和body的内容(如hello)

a.html

扫描二维码关注公众号,回复: 1212155 查看本文章
[html]  view plain copy
  1. <frameset cols="50%,*">  
  2.     <!--noresize 不允许改变窗口大小 frameborder="0"没有边框,b和c都要添加-->  
  3.     <!--框架起名,b.html页面超链接点击后,会在c页面所在位置出现-->  
  4.     <frame name="frame1" src="b.html" noresize frameborder="0"/>  
  5.     <frame name="frame2" src="c.html" frameborder="0"/>  
  6. </frameset>  

b.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="pink">  
  4.         <!--target表示我们点击后,目标指向谁,替换哪个框架-->  
  5.         <a href="zjl.html" target="frame2">周杰伦</a><br/>  
  6.         <a href="qq.html" target="frame2">齐秦</a>  
  7.     </body>  
  8. </html>  

c.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="silver">  
  4.         <p>c.html</p>  
  5.     </body>  
  6. </html>  

zjl.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="blue">   
  4.         <p>周杰伦的歌</p>  
  5.     </body>  
  6. </html>  

qq.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="gray">   
  4.         <p>齐秦的歌</p>  
  5.     </body>  
  6. </html>  

target属性值有四个

1._blank:表示打开一个全新的页面
2._self:替换本页面
3._top:整个浏览器窗口
4._parent:父窗口
5.target值中直接写对应的那个frame的名字

小练习


纵向分割,横向分割

这种结构往往都是在后台,前台很少用,框架多用于后台管理的页面,前台用浮动窗口


实现:点击青花瓷,在歌词大全处切换成,青花瓷的歌词



all.html

[html]  view plain copy
  1. <frameset rows="20%,*">  
  2.     <!--scrolling="no"不出现滚动轴-->  
  3.     <frame src="top.html" scrolling="no"/>  
  4.     <!--对下面的80%再左右分割-->  
  5.     <frameset cols="20%,*">  
  6.         <frame src="left.html" />  
  7.         <frame src="right.html" name="myframe" />  
  8.     </frameset>  
  9. </frameset>  

top.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="green">  
  4.         <p>Top</p>  
  5.     </body>  
  6. </html>  

left.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="yellow">  
  4.         <ul>  
  5.             <li><a href="qhc.html" target="myframe">青花瓷</a></li>  
  6.             <li><a href="dbr.html" target="myframe">当兵的人</a></li>  
  7.         </ul>  
  8.     </body>  
  9. </html>  

right.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="red">  
  4.         <p>歌词大全</p>  
  5.     </body>  
  6. </html>  

qhc.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="blue">   
  4.         <p>青花瓷的歌词</p>  
  5.     </body>  
  6. </html>  

dbr.html

[html]  view plain copy
  1. <html>  
  2.     <head></head>  
  3.     <body bgcolor="gray">   
  4.         <p>当兵的人的歌词</p>  
  5.     </body>  
  6. </html>  

猜你喜欢

转载自blog.csdn.net/i_amking/article/details/44083823