w3c组织给出html4的样式建议

所属分类: 网页制作 / HTML/Xhtml 阅读数: 386
收藏 0 赞 0 分享
这是w3c组织给出html4的样式建议,可惜浏览器们都加上自己的私有属性,让标准成了浮云。不过对于我们仍然是很有参考意义的。
Appendix D. Default style sheet for HTML 4
This appendix is informative, not normative.

This style sheet describes the typical formatting of all HTML 4 ([HTML4]) elements based on extensive research into current UA practice. Developers are encouraged to use it as a default style sheet in their implementations.

The full presentation of some HTML elements cannot be expressed in CSS 2.1, including replaced elements ("img", "object"), scripting elements ("script", "applet"), form control elements, and frame elements.

For other elements, the legacy presentation can be described in CSS but the solution removes the element. For example, the FONT element can be replaced by attaching CSS declarations to other elements (e.g., DIV). Likewise, legacy presentation of presentational attributes (e.g., the "border" attribute on TABLE) can be described in CSS, but the markup in the source document must be changed.

html, address, 
blockquote, 
body, dd, div, 
dl, dt, fieldset, form, 
frame, frameset, 
h1, h2, h3, h4, 
h5, h6, noframes, 
ol, p, ul, center
dir, hr, menu, pre   { displayblock } 
li              { displaylist-item } 
head            { displaynone } 
table           { display: table } 
tr              { displaytable-row } 
thead           { displaytable-header-group } 
tbody           { displaytable-row-group } 
tfoot           { displaytable-footer-group } 
col             { displaytable-column } 
colgroup        { displaytable-column-group } 
td, th          { displaytable-cell } 
caption         { displaytable-caption } 
th              { font-weightboldertext-aligncenter } 
caption         { text-aligncenter } 
body            { margin8px } 
h1              { font-size2emmargin: .67em 0 } 
h2              { font-size1.5emmargin: .75em 0 } 
h3              { font-size1.17emmargin: .83em 0 } 
h4, p, 
blockquote, ul, 
fieldset, form, 
ol, dl, dir, 
menu            { margin1.12em 0 } 
h5              { font-size: .83emmargin1.5em 0 } 
h6              { font-size: .75emmargin1.67em 0 } 
h1, h2, h3, h4, 
h5, h6, b, 
strong          { font-weightbolder } 
blockquote      { margin-left40pxmargin-right40px } 
i, cite, em, 
var, address    { font-styleitalic } 
pre, tt, code
kbd, samp       { font-family: monospace } 
pre             { white-spacepre } 
button, textarea, 
input, select   { displayinline-block } 
big             { font-size1.17em } 
smallsub, sup { font-size: .83em } 
sub             { vertical-alignsub } 
sup             { vertical-alignsuper } 
table           { border-spacing2px; } 
thead, tbody, 
tfoot           { vertical-alignmiddle } 
td, th, tr      { vertical-align: inherit } 
s, strike, del  { text-decorationline-through } 
hr              { border1px inset } 
ol, ul, dir, 
menu, dd        { margin-left40px } 
ol              { list-style-typedecimal } 
ol ul, ul ol, 
ul ul, ol ol    { margin-top0margin-bottom0 } 
u, ins          { text-decorationunderline } 
br:before       { content"\A"white-spacepre-line } 
center          { text-aligncenter } 
:link, :visited { text-decorationunderline } 
:focus          { outlinethin dotted invert } 
 
/* Begin bidirectionality settings (do not change) */ 
BDO[DIR="ltr"]  { directionltrunicode-bidibidi-override } 
BDO[DIR="rtl"]  { directionrtlunicode-bidibidi-override } 
 
*[DIR="ltr"]    { directionltrunicode-bidiembed } 
*[DIR="rtl"]    { directionrtlunicode-bidiembed } 
 
@media print { 
  h1            { page-break-beforealways } 
  h1, h2, h3, 
  h4, h5, h6    { page-break-afteravoid } 
  ul, ol, dl    { page-break-beforeavoid } 
}
Appendix D. Default style sheet for HTML 4
更多精彩内容其他人还在看

html 网页中的锚点(命名锚记)的使用介绍

html中的锚点想必大家并不陌生吧,锚点是网页制作中超级链接的一种,又叫命名锚记,下面以实例的方式为大家介绍下锚点的使用,不了解的朋友可不要错过哦
收藏 0 赞 0 分享

html中使用js来获取本地系统时间

获取本地系统时间的方法有很多,接下来为大家介绍喜爱使用js获取的具体实现,感兴趣的可以参考下
收藏 0 赞 0 分享

表单文件选择框样式自定义示例

大家都知道表单文件的选择框样式都是默认的,很不美观,下面就为大家写一个,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

让pre标签自动换行示例代码

pre 元素可定义预格式化的文本。被包围在 pre 元素中的文本通常会保留空格和换行符,下面为大家介绍下如何让pre标签自动换行,感兴趣的朋友可以参考下
收藏 0 赞 0 分享

DIV背景半透明文字不半透明的样式

DIV背景半透明,DIV中的字不半透明如何实现,下面有个不错的示例,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

html中的div、td 、p 等容器内强制换行和不换行的实现

div、td 、p 等容器内强制换行和不换行,在某些情况下还是比较实用的,下面本文整理了一些相关方面的知识,并有具体的实现方法,需要的朋友可以参考下
收藏 0 赞 0 分享

html 文本框(text)不可用只读的多种实现方法

有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,本文整理了多种实现方法,感兴趣的朋友可以参考下
收藏 0 赞 0 分享

HTML网页头部代码实例详解

HTML中我们一般把部分称为网页的头部。头部部分的内容虽然不会在页面中显示,但它能影响到搜索引擎对网页的收录和排序,以及网页的各种全局设置,可以说是至关重要
收藏 0 赞 0 分享

Html注释 Html中标记文字注释的符号

HTML注释,我们经常要在一些代码旁做一些HTML注释,这样做的好处很多,比如:方便查找,方便比对,方便项目组里的其它程序员了解你的代码,而且可以方便以后你对自己代码的理解与修改等等
收藏 0 赞 0 分享

Html 元素隐藏的几种方式

隐藏Html元素的方法最常用的方法有,css的display:none,一种方法两种实现方式,感兴趣的朋友可以了解下
收藏 0 赞 0 分享
查看更多