CSS---UL's browser default padding

Source: Internet
Author: User

Write code today encountered a problem, the UL List-style-type set to None, UL and outside the box always have a distance. Toss for a long time, finally the UL padding set to 0 after finally solve the problem.

The code is as follows:

    

Finally, the result is an explicit

  

Finally find the answer found is the HTML default style of the ghost. Both ul in IE, Firefox default padding-left:40px (other browsers not tested).

To prevent a similar problem later, the HTML and browser default styles are queried for the following:

An HTML default style

    1. Head {Display:none}/* does not display by default */
    2. body {margin:8px; line-height:1.12}
    3. h1 {font-size:2em; margin:. 67em 0}
    4. h2 {font-size:1.5em; margin:. 75em 0}
    5. h3 {font-size:1.17em; margin:. 83em 0}
    6. H4, P, BLOCKQUOTE, UL, fieldset, form, OL, DL, dir, menu {margin:1.12em 0}
    7. h5 {font-size:. 83em; Margin:1.5em 0}
    8. h6 {font-size:. 75em; Margin:1.67em 0}
    9. H1, H2, H3, H4, H5, H6, B,strong {Font-weight:bolder}
    10. Li {display:list-item}/* is displayed as a list by default */
    11. OL, UL, dir, menu, dd {margin-left:40px}
    12. OL {List-style-type:decimal}
    13. OL UL, ul OL, UL UL, ol ol {margin-top:0; margin-bottom:0}

Table section:

  1. Table {display:table}/* default to tabular display */
  2. TR {Display:table-row}/* is displayed by default for table rows */
  3. thead {Display:table-header-group}/* is grouped by default for table headers */
  4. tbody {Display:table-row-group}/* is grouped by default for table rows */
  5. tfoot {display:table-footer-group}/* default for group display at bottom of table */
  6. Col {display:table-column}/* is displayed by default for table columns */
  7. Colgroup {display:table-column-group}/* is displayed grouped by default for table columns */
  8. TD, Th {Display:table-cell;} /* Default is cell display */
  9. Caption {display:table-caption}/* is displayed by default for table headings */
  10. th {font-weight:bolder; Text-align:center}/* is displayed by default for table headings, and is rendered in bold center state */
  11. Caption {text-align:center}/* default to table title display, center state */
  12. Table {border-spacing:2px;}
  13. THEAD, Tbody, tfoot {vertical-align:middle}/* definition header, principal table, table foot element default to vertical alignment */
  14. TD, Th {Vertical-align:inherit}/* define cells, column headings default to vertical to Zimmer think inherit */

Other:

  1. blockquote {margin-left:40px; margin-right:40px}
  2. I, cite, Em,var, address {font-style:italic}
  3. Pre, TT, code, KBD, Samp {font-family:monospace}
  4. Pre {White-space:pre}
  5. button, textarea, input, object, select {Display:inline-block;}
  6. Big {Font-size:1.17em}
  7. Small, Sub, sup {font-size:. 83em}
  8. Sub {vertical-align:sub}/* defines sub element default to subscript */
  9. sup {vertical-align:super}/* definition sub element default to superscript display */
  10. S, strike, del {Text-decoration:line-through}/* define these elements default to strikethrough display */
  11. HR {border:1px inset}/* defines the 1px width of the split line by default as a 3D concave edge effect */
  12. U, ins {text-decoration:underline}
  13. Br:before {content: "A"}/* defines the pseudo-object content style of the wrapping element */
  14. : Before,: After {white-space:pre-line}/* defines the default style for pseudo-object space characters */
  15. Center {Text-align:center}
  16. ABBR, acronym {font-variant:small-caps; Letter-spacing:0.1em}
  17. : Link,: visited {text-decoration:underline}
  18. : Focus {Outline:thin dotted invert}
  19. /* Begin bidirectionality settings (don't change) */
  20. Bdo[dir= "ltr"] {direction:ltr; unicode-bidi:bidi-override}/* define BDO element The default text read/write display order when its property is dir= "ltr" */
  21. Bdo[dir= "RTL"] {Direction:rtl; unicode-bidi:bidi-override}/* define BDO element The default text read/write display order when its property is Dir= "RTL" */
  22. *[dir= "ltr"] {direction:ltr; unicode-bidi:embed}/* defines any element when its property is dir= "ltr" The default text read/write display order */
  23. *[dir= "RTL"] {Direction:rtl; unicode-bidi:embed}/* defines any element when its property is Dir= "RTL" the default text read/write display order */
  24. @media Print {/* Define the default plot style for headings and lists */
  25. h1 {Page-break-before:always}
  26. H1, H2, H3, H4, H5, h6 {page-break-after:avoid}
  27. UL, OL, DL {page-break-before:avoid}

Second, browser default style

Page margins:

    1. IE defaults to 10px, set by the body's margin property
    2. FF defaults to 8px, via the body's Padding property setting

Segment spacing:

    1. IE defaults to 19px, set by the Margin-top property of P
    2. The FF defaults to 1.12EM, which is set by the Margin-bottom property of P

Title Style:

    1. H1~h6 default bold display: Font-weight:bold;.

List style:

    1. ie default to 40px, through the margin properties of UL, OL set
    2. FF default is 40px, through the UL, Ol padding property settings
    3. The DL does not indent, but the internal description element dd is indented by default at 40px, while the name element DT is not indented.

Element centered

    1. ie default is text-align:center;
    2. FF defaults to Margin-left:auto;margin-right:auto;

Hyperlink style

    1. A style is underlined by default, the display color is blue, the hyperlinks that have been visited become purple

Mouse styles

    1. ie default is Cursor:hand;
    2. FF defaults to Cursor:pointer;. This statement is also valid in IE

Picture link Style

    1. ie default to purple 2px border line
    2. FF default to blue 2px border line

CSS---UL's browser default padding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.