HTML默认样式
各种HTML标签:h1-h6,p,ul,ol,dl…即使没有给他们定义样式属性值,他们在浏览器中显示时,也会具有各种样式属性(主要是字体大小和各种间距)。这是因为浏览器和CSS给这些标签设置了默认的样式属性值,各种版本的浏览器和CSS可能略有差别,下面列举的是Firefox 1.5 和CSS 2.1(IE)设置的一些常见标签的默认样式属性值。
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 { display: block }/*以上列表元素默认状态下一块状显示,未显示的将以内联元素显示,该列表针对HTML4版本,部分元素在XHTML1中将废弃*/
li { display: list-item }/*默认以列表显示*/
head { display: none }/*默认不显示*/
table { display: table }/*默认为表格显示*/
tr { display: table-row }/*默认为表格行显示*/
thead { display: table-header-group }/*默认为表格头部分组显示*/
tbody { display: table-row-group }/*默认为表格行分组显示*/
tfoot { display: table-footer-group }/*默认为表格底部分组显示*/
col { display: table-column }/*默认为表格列显示*/
colgroup { display: table-column-group }/*默认为表格列分组显示*/
td, th { display: table-cell; }/*默认为单元格显示*/
caption { display: table-caption }/*默认为表格标题显示*/
th { font-weight: bolder; text-align: center }/*默认为表格标题显示,呈现加粗居中状态*/
caption { text-align: center }/*默认为表格标题显示,呈现居中状态*/
body { margin: 8px; line-height: 1.12 }
h1 { font-size: 2em; margin: .67em 0 }
h2 { font-size: 1.5em; margin: .75em 0 }
我怎么这么好看h3 { font-size: 1.17em; margin: .83em 0 }
h4, p, blockquote, ul, fieldset, form, ol, dl, dir, menu { margin: 1.12em 0 }
h5 { font-size: .83em; margin: 1.5em 0 }
h6 { font-size: .75em; margin: 1.67em 0 }
h1, h2, h3, h4, h5, h6, b,strong { font-weight: bolder }
blockquote { margin-left: 40px; margin-right: 40px }
i, cite, em,var, address { font-style: italic }
pre, tt, code, kbd, samp { font-family: monospace }
pre { white-space: pre }
button, textarea, input, object, select { display:inline-block; }
big { font-size: 1.17em }
small, sub, sup { font-size: .83em }
sub { vertical-align: sub }/*定义sub元素默认为下标显示*/
sup { vertical-align: super }/*定义sub元素默认为上标显示*/
table { border-spacing: 2px; }
thead, tbody, tfoot { vertical-align: middle }/*定义表头、主体表、表脚元素默认为垂直对齐*/
td, th { vertical-align: inherit }/*定义单元格、列标题默认为垂直对齐默认为继承*/
s, strike, del { text-decoration: line-through }/*定义这些元素默认为删除线显示*/
hr { border: 1px inset }/*定义分割线默认为1px宽的3D凹边效果*/
ol, ul, dir, menu, dd { margin-left: 40px }
ol { list-style-type: decimal }
ol ul, ul ol, ul ul,
ol ol { margin-top: 0; margin-bottom: 0 }
u, ins { text-decoration: underline }
br:before { content: "A" }/*定义换行元素的伪对象内容样式*/
:before, :after { white-space: pre-line }/*定义伪对象空格字符的默认样式*/
center { text-align: center }
abbr, acronym { font-variant: small-caps; letter-spacing: 0.1em }
:link, :visited { text-decoration: underline }
:focus { outline: thin dotted invert }
/* Begin bidirectionality settings (do not change) */
BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override }/*定义BDO元素当其属性为DIR="ltr"时的默认文本读写显示顺序*/
BDO[DIR="rtl"] { direction: rtl; unicode-bidi: bidi-override }/*定义BDO元素当其属性为DIR="rtl"时的默认文本读写显示顺序*/
*[DIR="ltr"] { direction: ltr; unicode-bidi: embed }/*定义任何元素当其属性为DIR="ltr"时的默认文本读写显示顺序*/
*[DIR="rtl"] { direction: rtl; unicode-bidi: embed }/*定义任何元素当其属性为DIR="rtl"时的默认文本读写显示顺序*/
@media print { /*定义标题和列表默认的打印样式*/
h1 { page-break-before: always }
h1, h2, h3, h4, h5, h6 { page-break-after: avoid }
ul, ol, dl { page-break-before: avoid }
}
各种浏览器默认样式
-
----
IE6:
-----
[dir=rtl] dd {
margin: 0 30pt 0 0;
}
[dir=rtl] menu {
margin: 14pt 30pt 14pt 0;
}
[dir=rtl] ol {
margin: 14pt 30pt 14pt 0;
}
[dir=rtl] ul {
margin: 14pt 30pt 14pt 0;
}
a {
color: #00F;
text-decoration: underline;
}
a:visited {
color: #80080;
}
address {
display: block;
font-style: italic;
}
b {
font-weight: bold;
}
bdo {
direction: rtl;
unicode-bidi: bidi-override;
}
blockquote {
display: block;
margin: 14pt 30pt;
}
body {
display: block;
margin: 15px 10px;
zoom: 1;
}
button {
background-color: #D4D0C8;
border-style: outset;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
text-align: center;
zoom: 1;
}
caption {
display: block;
padding: 1px 3px 5px;
text-align: center;
zoom: 1;
}
cite {
font-style: italic;
}
code {
font-family: monospace;
font-size: 10pt;
}
col {
border-color: #D4D0C8;
display: block;
}
colgroup {
border-color: #D4D0C8;
display: block;
}
dd {
display: block;
margin: 0 0 0 30pt;
}
del {
text-decoration: line-through;
}
dfn {
font-style: italic;
}
div {
display: block;
}
dl {
display: block;
margin: 14pt 0;
}
dt {
display: block;
}
em {
font-style: italic;
}
embed {
zoom: 1;
}
fieldset {
border-style: groove;
border-width: 2px;
display: block;
zoom: 1;
}
form {
display: block;
margin: 14pt 0;
}
h1 {
display: block;
font-size: 24pt;
font-weight: bold;
margin: 14pt 0;
}
h2 {
display: block;
font-size: 18pt;
font-weight: bold;
margin: 14pt 0;
}
h3 {
display: block;
font-size: 13.55pt;
font-weight: bold;
margin: 14pt 0;
}
h4 {
display: block;
font-weight: bold;
margin: 14pt 0;
}
h5
{
display: block;
font-size: 10pt;
font-weight: bold;
margin: 14pt 0;
}
h6 {
display: block;
font-size: 7.55pt;
font-weight: bold;
margin: 14pt 0;
}
hr {
text-align: center;
zoom: 1;
}
html {
overflow-x: auto;
overflow-y: scroll;
zoom: 1;
}
i {
font-style: italic;
}
iframe {
background-color: #FFF;
height: 150px;
width: 300px;
zoom: 1;
}
img {
zoom: 1;
}
input {
background-color: #FFF;
border-style: inset;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
padding: 1px;
zoom: 1;
}
ins {
text-decoration: underline;
}
kbd {
font-family: monospace;
font-size: 10pt;
}
legend {
zoom: 1;
}
li {
display: block;
}
menu {
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 14pt 0 14pt 30pt;
}
object {
zoom: 1;
}
ol {
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: decimal;
margin: 14pt 0 14pt 30pt;
}
optgroup {
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
}
option {
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
}
p {
display: block;
}
pre {
display: block;
font-family: monospace;
font-size: 10pt;
white-space: pre;
}
rp {
font-size: 6pt;
}
rt {
font-size: 6pt;
}
samp {
font-family: monospace;
font-size: 10pt;
}
select {
border-color: #FFF;
border-style: inset;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
zoom: 1;
}
small {
font-size: 10pt;
}
strong {
font-weight: bold;
}
sub {
font-size: 10pt;
}
sup {
font-size: 10pt;
}
table {
border-color: #D4D0C8;
display: block;
zoom: 1;
}
tbody {
border-color: #D4D0C8;
display: block;
}
td {
border-color: #D4D0C8;
display: block;
padding: 1px;
zoom: 1;
}
textarea {
background-color: #FFF;
border-style: inset;
border-width: 2px;
font-family: monospace;
font-size: 10pt;
overflow-x: hidden;
overflow-y: scroll;
padding: 1px;
white-space: pre;
zoom: 1;
}
tfoot {
border-color: #D4D0C8;
display: block;
}
th {
border-color: #D4D0C8;
display: block;
font-weight: bold;
padding: 1px;
text-align: center;
zoom: 1;
}
thead {
border-color: #D4D0C8;
display: block;
}
tr {
border-color: #D4D0C8;
display: block;
zoom: 1;
}
ul {
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 14pt 0 14pt 30pt;
}
var {
font-style: italic;
}
-----
IE7:
-----
[dir=rtl] dd {
margin: 0 30pt 0 0;
}
[dir=rtl] menu {
margin: 14pt 30pt 14pt 0;
}
[dir=rtl] ol {
margin: 14pt 30pt 14pt 0;
}
[dir=rtl] ul {
margin: 14pt 30pt 14pt 0;
}
a {
color: #06C;
text-decoration: underline;
}
a:visited {
color: #80080;
}
address {
display: block;
font-style: italic;
}
b {
font-weight: bold;
}
bdo {
direction: rtl;
unicode-bidi: bidi-override;
}
blockquote {
display: block;
margin: 14pt 30pt;
}
body {
display: block;
margin: 15px 10px;
zoom: 1;
}
button {
background-color: #F0F0F0;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
text-align: center;
zoom: 1;
}
caption {
display: block;
padding: 1px 300zzz 500zzz;
text-align: center;
zoom: 1;
}
cite {
font-style: italic;
}
code {
font-family: monospace;
font-size: 10pt;
}
col {
border-color: #F0F0F0;
display: block;
}
colgroup {
border-color: #F0F0F0;
display: block;
}
dd {
display: block;
margin: 0 0 0 30pt;
}
del {
text-decoration: line-through;
}
dfn {
font-style: italic;
}
div {
display: block;
}
dl {
display: block;
margin: 14pt 0;
}
dt {
display: block;
}
em {
font-style: italic;
}
embed {
zoom: 1;
}
fieldset {
border-style: groove;
border-width: 2px;
display: block;
padding: 0 2px 3px;
zoom: 1;
}
form {
display: block;
margin: 14pt 0;
}
h1 {
display: block;
font-size: 24pt;
font-weight: bold;
margin: 14pt 0;
}
h2 {
display: block;
font-size: 18pt;
font-weight: bold;
margin: 14pt 0;
}
h3 {
display: block;
font-size: 13.55pt;
font-weight: bold;
margin: 14pt 0;
}
h4 {
display: block;
font-weight: bold;
margin: 14pt 0;
怎样注册网易邮箱}
h5 {
display: block;
font-size: 10pt;
font-weight: bold;
margin: 14pt 0;
}
h6 {
display: block;
font-size: 7.55pt;
font-weight: bold;
margin: 14pt 0;
}
hr {
outline: 0 none;
text-align: center;
zoom: 1;
}
html {
overflow-x: auto;
overflow-y: scroll;
zoom: 1;
}
i {
font-style: italic;
}
iframe {
background-color: #FFF;
height: 150px;
width: 300px;
zoom: 1;
}
img {
zoom: 1;
}
input {
background-color: #FFF;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
padding: 1px;
zoom: 1;
}
ins {
text-decoration: underline;
}
kbd {
font-family: monospace;
font-size: 10pt;
}
legend {
padding: 0 2px;
zoom: 1;
}
li {
display: block;
}
menu {
display: block;天气晴朗
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 14pt 0 14pt 30pt;
}
object {
zoom: 1;
}
ol {
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: decimal;
margin: 14pt 0 14pt 30pt;
}
optgroup {
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
}
option {
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
}
p {
display: block;
}
pre {
display: block;
font-family: monospace;
font-size: 10p
t;
white-space: pre;
}
rp {
font-size: 6pt;
}
rt {
font-size: 6pt;
}
samp {
font-family: monospace;
font-size: 10pt;
}
select {
background-color: #FFF;
border-color: #FFF;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
zoom: 1;
}
阿修罗技能small {
font-size: 10pt;
}
strong {
font-weight: bold;
}
sub {
font-size: 10pt;
}
sup {
font-size: 10pt;
}
table {
border-color: #F0F0F0;
display: block;
zoom: 1;
}
tbody {
border-color: #F0F0F0;
display: block;
}
td {
border-color: #F0F0F0;
display: block;
padding: 1px;
zoom: 1;
}
textarea {
background-color: #FFF;
border-width: 2px;
font-family: monospace;
font-size: 10pt;
overflow-x: hidden;
overflow-y: scroll;
padding: 2px;
white-space: pre;
zoom: 1;
}
tfoot {
border-color: #F0F0F0;
display: block;
}
th {
border-color: #F0F0F0;
display: block;
font-weight: bold;
padding: 1px;
text-align: center;
zoom: 1;
}
thead {
border-color: #F0F0F0;
display: block;
}
tr {
border-color: #F0F0F0;
display: block;
zoom: 1;
}
ul {
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 14pt 0 14pt 30pt;
}
var {
font-style: italic;
}
-----
IE8:
-----
[dir=rtl] dd {
margin: 0 40px 0 0;
}
[dir=rtl] menu {
padding: 0 30pt 0 0;
}
[dir=rtl] ol {
padding: 0 30pt 0 0;
}
[dir=rtl] ul {
padding: 0 30pt 0 0;
}
a {
color: #06C;
text-decoration: underline;
}
a:visited {
color: #80080;
凭证式国债}
address {
display: block;
font-style: italic;
}
b {
font-weight: bold;
}
bdo {
direction: rtl;
unicode-bidi: bidi-override;
}
blockquote {
display: block;
margin: 1em 40px;
}
body {
display: block;
margin: 8px;
zoom: 1;
}
button {
background-color: #F0F0F0;
border-width: 3px;
box-sizing: border-box;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
padding: 1px 8px;
text-align: center;
zoom: 1;
}
caption {
display: table-caption;
text-align: center;
zoom: 1;
}
cite {
font-style: italic;
}
code {
font-family: monospace;
font-size: 10pt;
}
col {
box-sizing: border-box;
display: table-column;
}
colgroup {
box-sizing: border-box;
display: table-column-group;
}
dd {
display: block;
margin: 0 0 0 40px;
}
del {
text-decoration: line-through;
}
dfn {
font-style: italic;
}
div {
display: block;
}
dl {
display: block;
margin: 1em 0;
}
dt {
display: block;
}
em {
font-style: italic;
}
embed {
zoom: 1;
}
fieldset {
border-style: groove;
border-width: 2px;
display: block;
margin: 0 2px;
pa
dding: 0 2px 3px;
zoom: 1;
}
form {
display: block;
}
h1 {
display: block;
font-size: 2em;
font-weight: bold;
margin: 0.67em 0;
page-break-after: avoid;
}
h2 {
display: block;
font-size: 1.5em;
font-weight: bold;
margin: 0.83em 0;
page-break-after: avoid;
}
h3 {
display: block;
font-size: 1.17em;
font-weight: bold;
margin: 1em 0;
page-break-after: avoid;
}
h4 {
display: block;
font-size: 1em;
font-weight: bold;
margin: 1.33em 0;
page-break-after: avoid;
}
h5 {
display: block;
font-size: 0.83em;
font-weight: bold;
margin: 1.67em 0;
page-break-after: avoid;
}
h6 {
display: block;
font-size: 0.67em;
font-weight: bold;
margin: 2.33em 0;
page-break-after: avoid;
}
head {
display: none;
}
hr {
border-style: inset;
border-width: 1px;
display: block;
margin-bottom: 0.5em;
margin-top: 0.5em;
overflow: hidden;
text-align: center;
zoom: 1;
}
html {
display: block;
zoom: 1;
}
i {
font-style: italic;
}
iframe {
background-color: #FFF;
height: 150px;
width: 300px;
zoom: 1;
}
img {
zoom: 1;
}
input {
background-color: #FFF;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
padding: 1px;
zoom: 1;
}
ins {
text-decoration: underline;
}
kbd {
font-family: monospace;
font-size: 10pt;
}
legend {
padding: 0 2px;
zoom: 1;
}
li {
display: list-item;
}
menu {
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 1em 0;
padding: 0 0 0 30pt;
}
object {
zoom: 1;
}
ol {
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: decimal;
margin: 1em 0;
padding: 0 0 0 30pt;
}
optgroup {
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
}
option {
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
}
p {
display: block;
margin: 1em 0;
}
pre {
display: block;
font-family: monospace;
font-size: 10pt;
margin: 1em 0;
white-space: pre;
}
rp {
font-size: 6pt;
}
rt {
display: ruby-text;
font-size: 6pt;
}
ruby {
display: ruby;
}
samp {
事业越来越好的祝福语font-family: monospace;
font-size: 10pt;
}
select {
background-color: #FFF;
border-width: 1px;
box-sizing: border-box;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
zoom: 1;
}
small {
font-size: 0.83em;
}
strong {
font-weight: bold;
}
sub {
font-size: 0.83em;
}
sup {
font-size: 0.83em;
}
table {
border-color: #F0F0F0;
border-spacing: 2px 2px;
box-sizing: border-box;
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论