Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the HTML default stylesheet CSS properties except for the definitions of inline and block

Shulou Source: shulou.com Published: 2022-06-03 07:49:49 11月15日 Update

HTML default stylesheet CSS properties in addition to the definition of inline and block, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

At the beginning, * {margin:0;padding:0;}, when you need to use margins, you need to restore the default CSS value of HTML. I've been looking for this document before, but I happened to see it on w3 today. In addition to the definitions of inline and block, the main thing to note is the default style (margin and font-size) of tags such as body | h2~h7 | blockquote | menu | ul | ol | dd, etc. This is useful when you need to restore the default values. See the following for details:

The code is as follows:

Html,address,blockquote,body,dd,div,dl,dt,fieldset,form,frame,frameset,h2,h3,h4,h5,h6,h7,noframes,ol,p,ul,center,dir,hr,menu,pre {display:block}

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}

H2 {font-size:2em; margin:.67em 0}

H3 {font-size:1.5em; margin:.75em 0}

H4 {font-size:1.17em; margin:.83em 0}

H5,p,blockquote,ul,fieldset,form,ol,dl,dir,menu {margin:1.12em 0}

H6 {font-size:.83em; margin:1.5em 0}

H7 {font-size:.75em; margin:1.67em 0}

H2,h3,h4,h5,h6,h7,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}

Sup {vertical-align:super}

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}

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}

@ media print {

H2 {page-break-before:always}

H2,h3,h4

H5,h6,h7 {page-break-after:avoid}

Ul,ol,dl {page-break-before:avoid}

After reading the above, have you mastered the HTML default stylesheet CSS properties in addition to the definition of inline and block? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Style content time properties methods more problem helpless for this code reason this skills documentation usefulness tags articles experience industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Technology NVidia Apple macOS