Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 无序列表未正确显示_Html_Css_Internet Explorer_Firefox - Fatal编程技术网

Html 无序列表未正确显示

Html 无序列表未正确显示,html,css,internet-explorer,firefox,Html,Css,Internet Explorer,Firefox,以下是有关网页的链接: 在IE中,无序列表在每行之间显示最小的空白。然而,在Firefox中,有更多的空白 如何修复此网页,以便无论哪个浏览器查看此网页,无序列表都会显示为IE中的显示 我需要添加特定的doctype还是使用CSS?您的标记为每个标记提供了一个边距,请使用 ul li p { margin: 0px; } 它应该去掉空白。(或者只要使用p{margin:0px}如果您想从所有标记中删除它,而不管它们是否在列表中)您的标记为每个标记一个边距,请使用 ul li p {

以下是有关网页的链接:

在IE中,无序列表在每行之间显示最小的空白。然而,在Firefox中,有更多的空白

如何修复此网页,以便无论哪个浏览器查看此网页,无序列表都会显示为IE中的显示


我需要添加特定的doctype还是使用CSS?

您的
标记为每个
  • 标记提供了一个边距,请使用

    ul li p { 
      margin: 0px; 
    }
    

    它应该去掉空白。(或者只要使用
    p{margin:0px}
    如果您想从所有
    标记中删除它,而不管它们是否在列表中)

    您的
    标记为每个
  • 标记一个边距,请使用

    ul li p { 
      margin: 0px; 
    }
    

    它应该去掉空白。(如果您想从所有
    标记中删除它,而不管它们是否在列表中,也可以使用
    p{margin:0px}

    明确地从这些
    标记中删除边距,以便在所有浏览器中都具有类似的外观

    p {
      margin: 0;
    }
    

    这样做的原因是,如果没有提供其他样式表,则浏览器使用标准样式表。这些样式表在不同的浏览器中有所不同,因此您必须显式设置一些值或使用CSS重置样式(例如)。

    显式删除那些
    标记的边距,以便在所有浏览器中具有相似的外观

    p {
      margin: 0;
    }
    
    这样做的原因是,如果没有提供其他样式表,则浏览器使用标准样式表。这些样式表在不同的浏览器中有所不同,因此您必须显式设置一些值或使用CSS重置样式(例如)。

    使用重置CSS**

    CSS只是一个CSS样式的集合,它删除并消除HTML元素不一致的默认样式

    它只是清除web浏览器的默认值,您无需再次更改每个元素的这些差异

    //Reset CSS - include this stylesheet in your html page before your main css file
    
    
    /* http://meyerweb.com/eric/tools/css/reset/ 
     v2.0 | 20110126
     License: none (public domain)
    */
    
    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    b, u, i, center,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td,
    article, aside, canvas, details, embed, 
    figure, figcaption, footer, header, hgroup, 
    menu, nav, output, ruby, section, summary,
    time, mark, audio, video {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 100%;
        font: inherit;
        vertical-align: baseline;
    }
    
    
    /* HTML5 display-role reset for older browsers */
    
    article, aside, details, figcaption, figure, 
    footer, header, hgroup, menu, nav, section {
        display: block;
    }
    
    body {
        line-height: 1;
    }
    
    ol, ul {
        list-style: none;
    }
    blockquote, q {
        quotes: none;
    }
    
    blockquote:before, blockquote:after,
    q:before, q:after {
        content: '';
        content: none;
    }
    
    table {
        border-collapse: collapse;
        border-spacing: 0;
    }
    
    使用重置CSS**

    CSS只是一个CSS样式的集合,它删除并消除HTML元素不一致的默认样式

    它只是清除web浏览器的默认值,您无需再次更改每个元素的这些差异

    //Reset CSS - include this stylesheet in your html page before your main css file
    
    
    /* http://meyerweb.com/eric/tools/css/reset/ 
     v2.0 | 20110126
     License: none (public domain)
    */
    
    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    b, u, i, center,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td,
    article, aside, canvas, details, embed, 
    figure, figcaption, footer, header, hgroup, 
    menu, nav, output, ruby, section, summary,
    time, mark, audio, video {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 100%;
        font: inherit;
        vertical-align: baseline;
    }
    
    
    /* HTML5 display-role reset for older browsers */
    
    article, aside, details, figcaption, figure, 
    footer, header, hgroup, menu, nav, section {
        display: block;
    }
    
    body {
        line-height: 1;
    }
    
    ol, ul {
        list-style: none;
    }
    blockquote, q {
        quotes: none;
    }
    
    blockquote:before, blockquote:after,
    q:before, q:after {
        content: '';
        content: none;
    }
    
    table {
        border-collapse: collapse;
        border-spacing: 0;
    }
    

    为什么在列表项中使用段落?为什么在列表项中使用段落?