样式表设置不显示
  • IE 和 Firefox 上的新行内容
  • 发布于 2024-12-17 16:54:51 字数 526 浏览 3 评论 0 原文

    在我正在编码的网页上,我发现 Chrome 和(IE 和 Firefox)之间显示列表的差异。

    我想我的样式表是错误的。但在哪里呢? 为什么 IE 和 Firefox 中“li”的内容会被设置为换行? 我想

    在我的样式表上像 Chrome 一样显示:

        a {
        color: #F60;
        text-decoration: none;
        }
    
        a:hover{
        color: #F60;
        text-decoration: underline
        }
    
        li {
        margin: 0px 0px 0px 10px;
        }
    

    结果如下图所示:

    在此处输入图像描述

    我尝试过

        ul{
        display: inline
        }
    

    ,但它删除了头上的标记。

    On the web page which I am coding, I found difference in displaying list between Chrome and (IE and Firefox).

    I suppose my style sheet is wrong. But where?
    Why the contents of "li" are set to new line on IE and Firefox?
    I want display like Chrome

    On My Stylesheet:

        a {
        color: #F60;
        text-decoration: none;
        }
    
        a:hover{
        color: #F60;
        text-decoration: underline
        }
    
        li {
        margin: 0px 0px 0px 10px;
        }
    

    The Result is as this image:

    enter image description here

    I tried

        ul{
        display: inline
        }
    

    but, it removed marker on the head.

    如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

    扫码二维码加入Web技术交流群

    发布评论

    需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

    评论(1

    め可乐爱微笑 2024-12-24 16:54:51

    看来是这个错误,但这意味着你的 是块元素。
    顺便说一句,不需要在 :hover 中重新定义相同的颜色。

    It seems it's this bug, but it implies that your <a> are block elements.
    By the way, don't need to redefine same color in :hover.

    ~没有更多了~
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文