被网上HTML5强大的效果震撼了 决定自己学习体验一下 鉴于之前HTML也只是非常基础的了解过一下 没有实战 所以在学习新标签前 跟着w3schools上的HTML教程走一遍 也发现了一些之前没注意的属性或者标签用法之类的东西 简单列下做拾遗(个人角度)
Basic中的
类似font,size,align之类的标签都应当使用style属性描述(CSS)
属性target="_blank" 新标签打开 同理 还有_top等属性(打开目标 也可设为某frame)
书签标签<a name="tip"> 访问<a href="#tip"> 不同页<a href="www.aaa.com/#tip">
<img>的alt属性为当图片不可显示时代替的文本
<img usemap="#aaamap"> 定义map<map name="aaamap"></map> map标签中为<area shape="rect" coords="0,0,80,100" alt="abc" href="" />
Table中的<th>标签 会使文本自动加粗居中 cellspacing 单元格间距 cellpadding 单元格内部空间 colspan 合并单元格
Table属性frame控制边框显示 表头<caption>标签
列表除<ol><ul>可定义样式type属性(内部<li>) 还有<dl>用于定义解释 内部标签<dt>定义<dd>描述
<frameset rows(cols)="分配"><frame /><frame /></frameset> 可设定noresize
<iframe>
Advance中的
2种布局layout方式 表格布局/div标签布局
Doctypes 声明规则
style3种方式 外部 内部 行内(属性)
外部:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
内部:
<head>
<style type="text/css">
body {background-color:yellow;}
p {color:blue;}
</style>
</head>
行内属性:
<p style="color:blue;margin-left:20px;">This is a paragraph.</p>
<head>标签内可用<title> <base> <link> <meta> <script> <style>
<meta>用于页面描述
例如:<meta name="description" content="Free Web tutorials on HTML, CSS, XML" />
<meta name="keywords" content="HTML, CSS, XML" />
可被搜索引擎找到
<noscript>当script不被支持时显示
Entities 类似转义符
URL:scheme://host.domain:port/path/filename
最后附上Quick List:(转自http://www.w3schools.com/html/html_quick.asp)
HTML Basic Document
<html>
<head>
<title>Title of document goes here</title>
</head>
<body>
Visible text goes here...
</body>
</html>
Heading Elements
<h1>Largest Heading</h1>
<h2> . . . </h2>
<h3> . . . </h3>
<h4> . . . </h4>
<h5> . . . </h5>
<h6>Smallest Heading</h6>
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
Ordinary link: <a href="http://www.example.com/">Link-text goes here</a>
Image-link: <a href="http://www.example.com/"><img src="URL" alt="Alternate Text" /></a>
Mailto link: <a href="mailto:[email protected]">Send e-mail</a>
A named anchor:
<a name="tips">Tips Section</a>
<a href="#tips">Jump to the Tips Section</a>
Unordered list
<ul>
<li>Item</li>
<li>Item</li>
</ul>
Ordered list
<ol>
<li>First item</li>
<li>Second 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>Tableheader</th>
<th>Tableheader</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="email" size="40" maxlength="50" />
<input type="password" />
<input type="checkbox" checked="checked" />
<input type="radio" checked="checked" />
<input type="submit" value="Send" />
<input type="reset" />
<input type="hidden" />
<select>
<option>Apples</option>
<option selected="selected">Bananas</option>
<option>Cherries</option>
</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 a source.
</blockquote>
<address>
Written by W3Schools.com<br />
<a href="mailto:[email protected]">Email us</a><br />
Address: Box 564, Disneyland<br />
Phone: +12 34 56 78
</address>