HTML Basic Document
<html> <head> <title> Document name goes here </title> </head> <body> Visible text goes here </body> </html>
Text Elements
<p>This is a paragraph</p> <br /> (line break) --换行 <hr /> (horizontal rule) --横线 <pre>This text is preformatted</pre>
Logical Styles
<em>This text is emphasized</em> <strong>This text is strong</strong> <code>This is some computer code</code>
Physical Styles
<b>This text is bold</b> 加粗 <i>This text is italic</i> 斜体
Links, Anchors, and Image Elements (--添加超链接)
<a href="http://www.example.com/"> This is a Link </a>
<a href="http://www.example.com/"><img src="URL" alt="Alternate Text"></a>
<a href="mailto:webmaster@example.com">Send e-mail</a>A named anchor: --发送邮件
<a name="tips">Useful Tips Section</a>
<a href="#tips">Jump to the Useful Tips Section</a>
Unordered list
<ul> <li>First item</li> <li>Next item</li> </ul>
Ordered list
<ol> <li>First item</li> <li>Next item</li> </ol>
Definition list
<dl> <dt>First term</dt> --列表内容 <dd>Definition</dd> --内容描述(换行后有退格) <dt>Next term</dt> <dd>Definition</dd> </dl>
Tables
<table border="1"> <tr> --定义表格中的行 <th>someheader</th> --定义表头(加粗显示) <th>someheader</th> </tr> <tr> <td>sometext</td> --表格内容 <td>sometext</td> </tr> </table>
Frames
<frameset cols="25%,75%"> --框架 列定义(两个页面以竖线分割) <frame src="page1.htm"> <frame src="page2.htm"> </frameset>
Forms
<form action="http://www.example.com/test.asp" method="post/get"> --表单用户单击确认按钮时,表单的内容会被传送到另一个文件
<input type="text" name="lastname" value="Nixon" size="30" maxlength="50"> --文本框
<input type="password"> --密码
<input type="checkbox" checked="checked"> --复选框
<input type="radio" checked="checked"> --单选按钮
<input type="submit"> --提交
<input type="reset"> --重置/复位
<input type="hidden"> --隐藏
<select> --选择列表框(对下面的分组用optgroup)
<option>Apples
<option selected>Bananas
<option>Cherries
</select>
<textarea name="Comment" rows="60" cols="20"></textarea> --文本域
</form>
Entities
< is the same as < --一些特殊元素的表示(各种表示是等价的) > is the same as > © is the same as ©
Other Elements
<!-- This is a comment --> <blockquote> Text quoted from some source. --上句话摘自另一个源的引用(有缩进) </blockquote> <address> --表示作者的信息,常放在首部或尾部 Address 1<br> Address 2<br> City<br> </address>
<head> </head> <title> --标题 <base href="http://www.w3school.com.cn/images/" /> --为页面上的所有链接规定默认地址或默认目标(target): <link rel="stylesheet" type="text/css" href="mystyle.css" /> -- 最常用于连接样式表 <meta name="keywords" content="HTML, CSS, XML" /> --如定义页面关键字 <script> --定义客户端脚本 <style type="text/css"> </style>
scheme://host.domain:port/path/filename --URL(统一资源定位符)
解释:
- scheme - 定义因特网服务的类型。最常见的类型是 http
- host - 定义域主机(http 的默认主机是 www)
- domain - 定义因特网域名,比如 w3school.com.cn
- :port - 定义主机上的端口号(http 的默认端口号是 80)
- path - 定义服务器上的路径(如果省略,则文档必须位于网站的根目录中)。
- filename - 定义文档/资源的名称
2720


&spm=1001.2101.3001.11974&articleId=50800678&d=1&t=3&u=76431c9466bf4bd2b91b4e7063224a87)

被折叠的 条评论
为什么被折叠?



