Sady Home

Note my coding life

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
HTML是轻松驾驭了,但也遇到几个很少用的标识:
Tag Description NN IE DTD
<!DOCTYPE>  Defines the document type     STF
<abbr> Defines an abbreviation 6.2   STF
<acronym> Defines an acronym 6.2 4.0 STF
<base> Defines a base URL for all the links in a page 3.0 3.0 STF
<bdo> Defines the direction of text display 6.2 5.0 STF
<caption> Defines a table caption 3.0 3.0 STF
<cite> Defines a citation 3.0 3.0 STF
<code> Defines computer code text 3.0 3.0 STF
<col> Defines attributes for table columns    3.0 STF
<colgroup> Defines groups of table columns   3.0 STF
<dd> Defines a definition description 3.0 3.0 STF
<dfn> Defines a definition term   3.0 STF
<dl> Defines a definition list 3.0 3.0 STF
<dt> Defines a definition term 3.0 3.0 STF
<em> Defines emphasized text  3.0 3.0 STF
<fieldset> Defines a fieldset 6.2 4.0 STF
<ins> Defines inserted text 6.2 4.0 STF
<kbd> Defines keyboard text 3.0 3.0 STF
<legend> Defines a title in a fieldset 6.2 4.0 STF
<optgroup> Defines an option group 6.0 6.0 STF
<param> Defines a parameter for an object 3.0 3.0 STF
<q> Defines a short quotation 6.2   STF
<samp> Defines sample computer code 3.0 3.0 STF
<sub> Defines subscripted text 3.0 3.0 STF
<sup> Defines superscripted text 3.0 3.0 STF
<tbody> Defines a table body   4.0 STF
<tfoot> Defines a table footer   4.0 STF
<th> Defines a table header 3.0 3.0 STF
<thead> Defines a table header   4.0 STF
<tt> Defines teletype text 3.0 3.0 STF
<var> Defines a variable 3.0 3.0 STF
 
今天才明白下面的应用区别:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<!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">

What Is XHTML?
  XHTML stands for EXtensible HyperText Markup Language
  XHTML is aimed to replace HTML
  XHTML is almost identical to HTML 4.01
  XHTML is a stricter and cleaner version of HTML
  XHTML is HTML defined as an XML application
  XHTML is a W3C Recommendation
The Most Important Differences:
  XHTML elements must be properly nested
  XHTML elements must always be closed
  XHTML elements must be in lowercase
  XHTML documents must have one root element
Some More XHTML Syntax Rules:
  Attribute names must be in lower case
  Attribute values must be quoted
  Attribute minimization is forbidden
  The id attribute replaces the name attribute
  The XHTML DTD defines mandatory elements (html, head, body and title)
 
The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}
  • p {font-family: "sans serif"} /*If  the value is multiple words, put quotes around the value.*/
  • h1,h2,h3,h4,h5,h6 {color: green}  /*Grouping*/
  • .right {text-align: right} /*The class Selector*/
  • p.right {text-align: right} /*The class selector rule matches the p element*/
  • <p class="center bold">Text</p> <!--To apply more than one class per given element-->
  • input[type="text"] {background-color: blue} /*Add Styles to Elements with Particular Attributes*/
  • #green {color: green} /*The id Selector*/
  • p#green {color: green} /*The id selector rule matches the p element*/
  • a.red:visited {color: #FF0000}


* Reference to W3C Schools

posted on 2007-10-17 10:39  Sady  阅读(277)  评论(0)    收藏  举报
凭飞堂