gpt4 book ai didi

html - 无法从 Internet Explorer 11 的列表中删除元素符号

转载 作者:行者123 更新时间:2023-11-27 23:39:13 24 4
gpt4 key购买 nike

我有一个 ul 列表,我无法让 Internet Explorer 停止在 li 上显示元素符号。我尝试了所有可以在网上找到的方法,但它们仍然存在。

HTML代码:

<ul>
<li>
<a href="/mydomain.com/en">EN</a>
</li>
<li>
<a href="/mydomain.com/fr">FR</a>
</li>
</ul>

CSS 代码:

ul {
margin: 0;
padding: 0;
height: 100%;
list-style: none;
// tried also list-style-type: none;
}

ul li {
display: inline;
list-style: none;
// tried also list-style-type: none;
float: left;
padding: 0;
height: 100%;
margin: 0 !important;
}

更新解决方案

还有一些其他的 CSS 规则被划掉了,它们不应该应用在网站上。其中之一是:

li:before {
content: '\25A0';
}

正如我所说,这个 CSS 在 Chrome、Mozilla 和 IE 的开发者工具中被划掉了。但是,当我在样式表中添加 content:none 时,元素符号就消失了。可能是 IE 上的错误,使用了被划掉的内容?

最佳答案

我无法在 IE11 中重现该问题。我使用外部、嵌入式和内联样式进行了测试,在所有情况下,元素符号都被正常移除,没有任何问题。

但是,这是一个记录在案的问题。

这似乎是 IE11 中的错误。有些人找到了 workaround通过将样式规则从外部样式表移动到 <head>文档的一部分(即使用嵌入样式)。其他人找到了 solution with the list-style-image property .

关于html - 无法从 Internet Explorer 11 的列表中删除元素符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32442840/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com