日期:2014-05-17  浏览次数:20698 次

HTML5学习准备--HTML4拾遗

?

被网上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:webmaster@example.com">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>

?