A. Setting and notes
- / ** Clear inside and outside margins ** /
- body, h1 of, H2, H3, H4, H5, H6, HR, P, blockquote, / * Structural Elements structural elements * /
- DL, dt, dd, UL, OL, Li, / * List Elements list element * /
- pre, / * Formatting text in text format Elements element * /
- form, the fieldset, Legend, Button, INPUT, TextArea, / * form Elements form element * /
- TH, TD / * Table Elements table elements * / {
- margin: 0;
- padding: 0;
- }
- / ** * Set the default font /
- body,
- button, input, select, textarea /* for ie */ {
- font: 14px / 1.5 tahoma, \ 5b8b \ 4f53, sans-serif;
- }
- h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: normal;}
- address, auf cite, DFN, EM, var { font-style: Normal;} / * * italics righting /
- code, kbd, pre, samp { font-family: courier new, courier, monospace; } /* 统一<a href="https://www.baidu.com/s?wd=等宽字体&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPjcvPvmkPW9WPWRLPj-b0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3En16srjm1rjcL" target="_blank" class="baidu-highlight">等宽字体</a> */
- {small font-size: 12px;} / * difficult to read in Chinese less than 12px, so small normalize * /
- / ** Reset list elements ** /
- ul, ol { list-style: none; }
- / ** ** reset text element /
- a { text-decoration: none; }
- a:hover { text-decoration: underline; }
- {SUP Vertical-align = left: text-Top;} / * reset, reduce the impact on high line * /
- sub { vertical-align: text-bottom; }
- / ** ** reset element form /
- legend { color: #000; } /* for ie6 */
- fieldset, img { border: 0;} / * img ride: let no link in the img border * /
- Button, INPUT, SELECT, TextArea { font-size: 100%;} / * so that form elements inherit the font size ie * /
- / * Note: optgroup not righting * /
- / ** Reset form elements ** /
- table { border-collapse: collapse; border-spacing: 0; }
- / * Reset HTML5 element * /
- article, aside, details, figcaption, figure, footer,header, hgroup, menu, nav, section,
- summary, time, mark, audio, video {
- display: block;
- margin: 0;
- padding: 0;
- }
- mark { background: #ff0; }
II. Practical application code
Recommended site, set a style sheet reset.css clear the default style of each browser, the page has been reached to do to achieve unity in every browser, following the YUI Reset CSS code is posted
- body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
- margin:0;
- padding:0;
- }
- table {
- border-collapse:collapse;
- border-spacing:0;
- }
- fieldset, img {
- border:0;
- }
- address,caption,cite,code,dfn,em,strong,th,var {
- font-style:normal;
- font-weight:normal;
- }
- ol,ul {
- list-style:none;
- }
- caption,th {
- text-align:left;
- }
- h1, h2, h3, h4, h5, h6 {
- font-size:100%;
- font-weight:normal;
- }
- q:before,q:after {
- content:'';
- }
- abbr,acronym {
- border:0;
- }
More professional front-end knowledge, make the [2048] ape www.mk2048.com