学习笔记——HTML

来源:互联网 发布:腾讯大数据 手游 编辑:程序博客网 时间:2024/05/01 23:20

  HTML简介

HTML---HyperText Markup Language(超文本标记语言)

扩展名:.htm  和  .html

常用编辑器:
所见即所得型:FrontPage  Dreamweaver
文本编辑器:EditPlus和UltraEdit

XHTML--eXtensible HyperText Markup Language(可扩展超文本标记语言)

XHTML首先必须是XML

XML结构化文档的四条基本原则:
1:整个文档有且仅有一个跟元素
2:每个元素都由开始标签和结束标签组成
3:元素与元素之间应该合理嵌套
4:元素的属性必须有属性值,且属性值应该用引号引起来。


 XHTML的规则


1:必须用DTD来定义语义约束
2:根元素是必须是<html>
3:根元素必须包含 xmlns="http://www.w3.org/1999/xhtml"
eg:<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4:DTD语义约束的3个选择
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
5:DTD子集不可覆盖任何DTD的参数实体

 

        XHTML的常用标签


1:最基本的标签
<html>:跟元素,必须指定以xmlnx属性,且值必须是xmlns="http://www.w3.org/1999/xhtml"
<head>:头元素

    <title>
<base>
  href
  target
<meta>
  http-equiv
  name
  content
<body>:主体
<style>:引入样式定义
<h1>到<h6>:标题1到6
<br />:换行
<hr />:水平线
<!--...-->:注释(多像个表情)
<p>:段落(默认之间有距离)
<div>:节
<span>:节(与<div>的区别是默认不会换行)
<script>
2:文本格式化标签
<strong>和<b>粗体文本
<i>斜体文本
<em>强调
<small><big>小、大号字体文本
<sup><sub>上下标文本
<bdo>文本的显示方向(使用dir属性,值为ltr或rtl)

3:超级链接和锚点
<a>超级连接href:超级连接所关联的另一个资源
target:


4:列表相关标签
<ul>无序列表
<ol>有序列表,属性start、type
<dl>列表
<dd>普通列表
<li>列表项目
<dt>标贴列表项

5:图像标签
<img>
  src、alt、height、width
<map>图像映射
<area>图像映射的内部区域
  shape=rect | circle | ploy
  coords
  href
  alt
  target

6:表格标签
<table>
align=left | center | right
  bgcolor
  border
  cellpadding
  cellspacing
<caption>表格标题
<thead>表格头
<tfoot>表格尾
<tr>表格行
  align=left | center | right | justify
  valign=top | middle | bottom | baseline
  bgcolor
<td>单元格
  align=left | center | right | justify
  valign=top | middle | bottom | baseline
  bgcolor
  colspan
  rowspan
  height
  width
<th>页眉的单元格,用法参照<td>
<tbody>表格主体
  align=left | center | right | justify
  valign=top | middle | bottom | baseline

6:框架相关标签
<frameset>
<frame>
<noframes>

7:表单标签
<form>输入表单
  action
  method=get | post
  enctype=application/x-www-form-urlencoded | multipart/form-data | text/plain
  id、name
  value
  target

<input>
  type=text | password | hidden | radio | checkbox | image | file | sumbit | reset | button
  checked="checked"
  diabled="disabled"
  maxlength
  readonly
  size
  align=left | right | top | texttop | middle | absmiddle | bottom | absbottom | baseline
  id、name
  value

<label>标签
  for

<button>

<select>列表框或下拉菜单
  diabled
  multiple
  size
 <option>列表项,菜单项
   diabled selectd value
 <optgroup>列表项组,菜单项组
   label disabled

<textarea>文本域
  cols
  rows
  diabled
  readonly

 

推荐学习网址:http://www.w3.org/html

                            http://www.w3school.com.cn/

原创粉丝点击