开始标签<b> 结束标签</b>
<body> 与 </body> 之间的文本是可见的页面内容
eg:
<html>
<body>
<h1>我的第一个标题</h1>
<h2>我的第二个标题</h2>
<h3>我的第三个标题</h3>
<p>我的第一个段落。</p>
<p>我的第二个段落。</p>
</body>
</html>
.html 生成网页
插入链接(href 属性中指定链接的地址):<a href="http://www.4399.com/"> 这是一个链接</a>
插入图片:<img src="/i/eg_w3school.gif" width="300" height="120" />
属性:总是以名称/值对的形式出现,比如:name="value"
eg:<body bgcolor="yellow"> 拥有关于背景颜色的附加信息。属性值在括号内
标题:是通过 <h1> - <h6> 从大到小定义。
水平线:<hr /> 标签在 HTML 页面中创建水平线。分隔内容
注释:<!里面加注释> 浏览器不会显示
下一行<br/>
font-family字体 color颜色 font-size字号 eg:<p style="font-family:arial;color:red;font-size:20px;>
pre预留标签:
从右向左输出 (rtl) : <bdo dir="rtl"> Here is some Hebrew text </bdo>
html链接target属性: <a href="http://www.w3school.com.cn/" target="_blank">Visit W3School!</a>新窗口链接
图像转换为文本:无法显示图像,将显示 "alt" 属性中的文本。<img src="/i/eg_goleft123.gif" alt="向左转" />
表格:tr-行 td-数据
eg(两行三列):
<table border="1">
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
" " -处理没有内容的单元格 标题-caption 横跨两列的单元格-colspan="2" <th>定义表头
横跨两行的单元格-rowspan="2" 单元格边距<table cellpadding="10" > 单元格间距<table cellspacing=“5">
背景颜色-bgcolor 背景图片-background 排列整齐align="left" 框架frame="box"“above”“below”“hsides”“vsides”
列表:
无序列表<ul> 有序列表 <ol start="10">
<li>咖啡</li> <li>咖啡</li>
<li>茶</li> <li>咖啡</li>
<li>牛奶</li> <li>茶</li>
</ul> </ol>
定义列表 <dl> 标签开始,自定义列表项以 <dt> 开始,自定义列表项的定义以 <dd> 开始
<dl>
<dt>Coffee</dt> Coffee
<dd>Black hot drink</dd> 变成 Black hot drink
<dt>Milk</dt> Milk
<dd>White cold drink</dd> White cold drink
</dl>
项目符号列表:type="disc","circle","square" 字母列表:type="A" 罗马字母列报表:type="Ⅰ"
类:
<style>.cities { background-color:black;color:white;margin:20px;padding:20px;} </style>
<div class="cities">……</div>
<style> span.red {color:red;}</style>
<h1>My <span class="red">Important</span> Heading</h1
布局:
<head>
<style>
#header {
background-color:black;
color:white;
text-align:center;
padding:5px;
}
#nav {
line-height:30px;
background-color:#eeeeee;
height:300px;
width:100px;
float:left;
padding:5px;
}
#section {
width:350px;
float:left;
padding:10px;
}
#footer {
background-color:black;
color:white;
clear:both;
text-align:center;
padding:5px;
}
</style>
</head>
<body>
<div id="header">内容</div>
<div id="nav">内容</div>
<div id="section">内容</div>
<div id="footer">内容</div>
</body>
</html>
框架:
竖直框架<frameset cols="25%,50%,25%">
水平框架<frameset rows="25%,50%,25%">
<frame src="/example/html/frame_a.html">
<frame src="/example/html/frame_b.html">
<frame src="/example/html/frame_c.html">
</frameset>
Frame 标签定义了放置在每个框架中的 HTML 文
<frameset cols="25%,75%"> <frame src="frame_a.htm"> <frame src="frame_b.htm"> </frameset>
定义不可以改变框架大小noresize="noresize"
内联框架:<iframe src="/i/eg_landscape.jpg"></iframe> frameborder="0"无边框
脚本:
<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript> Your browser does not support JavaScript! </noscript>