
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<link rel="stylesheet" type="text/css" href="Untitled-1.css">
<title>第一个</title>
</head>
<body>
<!--内联样式表-->
<div style="color:#00FF00" align="center">
<h3>This is a header</h3>
<p>This is a paragraph.</p>
</div>
<!--<span> 标签被用来组合文档中的行内元素。-->
<p class="tip"><span>提示:</span>... ... ...</p>
<p><span>some text.</span>some other text. </p>
<!--href=本地页面或是新的网页-->
<P><a href="http://www.cctv.com" target="_blank">新的页面</a></P>
<p><a href="http:www.cctv.com" target="_self">关掉此页面新打开一个</a></p>
</body>
</html>
代码1
@charset "utf-8";
/* CSS Document */
p.tip span {
font-weight:bold;
color:red;
}
css
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<title>第一个</title>
<style type="text/css">
div#container{width:500px}
div#header {background-color:#99bbbb;}
div#menu {background-color:#ffff99; height:200px; width:100px; float:left;}
div#content {background-color:#EEEEEE; height:200px; width:400px; float:left;}
div#footer {background-color:#99bbbb; clear:both; text-align:center;}
h1 {margin-bottom:0;}
h2 {margin-bottom:0; font-size:14px;}
ul {margin:0;}
li {list-style:none;}
</style>
</head>
<body>
<div id="container"> <div id="header">
<h1>Main Title of Web Page</h1>
</div>
<div id="menu">
<h2>Menu</h2>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</div> <div id="content">Content goes here</div> <div id="footer">Copyright W3School.com.cn</div> </div>
<table width="507" border="0">
<tr>
<td colspan="2" style="background-color:#99bbbb;">
<h1>Main Title of Web Page</h1>
</td>
</tr> <tr valign="top">
<td width="100" style="background-color:#ffff99;width:100px;text-align:top;">
<b>Menu</b><br />
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</td>
<td width="400" style="background-color:#EEEEEE;height:200px;width:400px;text-align:top;">
Content goes here</td>
</tr> <tr>
<td colspan="2" style="background-color:#99bbbb;text-align:center;">
Copyright W3School.com.cn</td>
</tr>
</table>
</body>
</html>
第二个
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<!---表单是一个包含表单元素的区域。
表单元素是允许用户在表单中(比如:文本域、下拉列表、单选框、复选框等等)输入信息的元素。
表单使用表单标签(<form>)定义。
<form>
...
input 元素
...
</form>-->
<!--注意,表单本身并不可见。同时,在大多数浏览器中,文本域的缺省宽度是20个字符。-->
<form>
First name: <input type="text" name="firstname" />
<br />
<br />
Last name: <input type="text" name="lastname" />
</form>
<form><!--name-->
<input type="radio" name="sex" value="male" /> Male
<br />
<input type="radio" name="sex" value="female" /> Female
</form>
<form><input type="checkbox" name="bike" />
I have a bike
<br /><input type="checkbox" name="car" />
I have a car
</form>
</body> </html>
表单