<!DOCTYPE html>
文档类型定义charset=UTF-8
字符编码集,万国码<head></head>
头部<body></body>
内容<!-- -->
注释<h1></h1>
<h2></h2>
<h3></h3>
<h4></h4>
<h5></h5>
<h6></h6>
<ul>
<li>第一项</li>
<li>第二项</li>
<li>第三项</li>
<li>第四项</li>
</ul>
<ol>
<li>第一项</li>
<li>第二项</li>
<li>第三项</li>
<li>第四项</li>
</ol>
<dl>
<dt>第一项</dt>
<dd>第二项</dd>
</dl>
<p></p>
文章段落<br/>
换行 
空格<blockquote></blockquote>
<q></q>
<a href="" target=""></a>
<img src="图片所在地址" alt="自己命名,方便查找">
<strong></strong>
(强调)<b></b>
<em></em>
<i></i>
<div></div>
<abbr title="Hyper Text Markup language">html</abbr>
figure>
<img src="img/151209173849244246.jpg" alt="米奇"/>
<figcaption>米奇</figcaption>
</figure>
<video src="img/movie.mp4" controls autoplay loop></video>
<audio src="img/Mrbaluoke.wav" controls autoplay loop></audio>
<table border="1">
<caption>学生登记表</caption>
<tr>
<th>姓名</th>表头
<th>年龄</th>
<th>班级</th>
<th>备注</th>
</tr>
<tr>
<td>张三</td>
<td>6</td>
<td>1-1</td>
<td>无</td>
</tr>
<tr>
<td>李四</td>
<td>6</td>
<td>1-1</td>
<td>无</td>
</tr>
<tr>
<td>王五</td>
<td>7</td>
<td>2-1</td>
<td>无</td>
</tr>
<tr>
<td colspan="4">由XX学校</td>
</tr>
</table>
<form action="#" method="post"></form>
<input type="text" placeholder="请输入账号" name="username"/>
<input type="password" maxlength="6" name="user_password"/>
<input type="button" value="搜索"/>
<input type="submit"/> <button>我是新的按钮</button>
足球 <input type="checkbox" name="sport"/>
头球 <input type="checkbox" name="sport"/>
手球 <input type="checkbox" name="sport" checked/>
单选框男 <input type="radio" name="sex"/>
女 <input type="radio" name="sex"/>
label for 一个 id id具有唯一性<label for="football">足球</label>
<input type="checkbox" name="sport" id="football"/>
下拉框<select name="" id="">
<option value="beijing">北京</option>
<option value="tianjing">天京</option>
<option value="dongjing">东京</option>
</select>
<textarea name="" id=""></textarea>
`<iframe src="http://www.baidu.com" width="700" height="500" frameborder="0"></iframe>`
{
声明;
属性:属性值;
}
{
margin: 0;
padding: 0; }
h3{
color: #00D600;
font-size: 30px;
font-family: "黑体","Microsoft Yahei",sans-serif; }
#test_h4_id{ color: blue; }
.test_class{ color: #eea236; }
input[type="text"]{ border: 1px solid red; }
a 颜色 a:link{ color: #000; }
访问后 a:visited{ color: #ccc; }
鼠标移入||鼠标悬停 a:hover{ color: red; }
a点击时 一瞬间 a:active{ font-size: 20px; }
p span{ color: red;border: 1px solid red; }
p>span{ color: red; border: 1px solid red; }
h1,h2,h3,h4,h5,h6{ font-weight: normal; }
.testa:before{ content: "前前前"; }
.testa:after{ content: "反正有大把时光"; }
div{ width: 200px; border: 1px solid; }
div:first-letter{ font-size: 30px; }
div:first-line{ }
!importent>style>id>class>元素>通配符
子级的样式不是显示声明,从父级继承,但子级可以单独声明样式不影响父级,文字的样式会继承。
不被继承的:margin,padding,boeder,background
原文:http://www.cnblogs.com/yydmx/p/7260496.html