【问题标题】:IE11: <link> not workingIE11: <link> 不工作
【发布时间】:2018-08-01 22:32:51
【问题描述】:

我在&lt;head&gt; 标签之间插入以下内容:

<link rel="stylesheet" type="css/stylesheet" href="fileadmin/css/konsensusempfehlung.css">

此样式表确实会影响我在 Firefox 中的 HTML 代码。 但是在 IE11 中却没有。

konsensusempfehlung.css:

tr.hauptzeile {
    background-color: #FFFFFF;
    text-align: left;
}

tr.tr-even{
    background-color: #edf7f9;
}

th {
    padding: 0.5em;
}

td.td-0 {
    font-weight: bold;
}

td {
    padding: 0.5em;
}

.table-scrollable {
    width: 100%;
    overflow-y: auto;
    margin: 0 0 1em;
}

.table-scrollable::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
}

.table-scrollable::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 3px solid #fff;
    background-color: rgba(0, 0, 0, .3);
}

我该如何解决这个问题?

【问题讨论】:

  • 如果您收到一条消息说您的问题似乎主要是代码并且需要更多详细信息……请尝试提供更多详细信息,而不是将错误消息复制/粘贴到问题中六次。
  • 但这只是一个门槛,在这种情况下,问题已经用几句话完全描述了
  • 在浏览器的开发者控制台中查看资源。如果您的样式表根本没有出现,则您的link 标签是错误的。如果它只显示 404,则您的 href 路径是错误的。

标签: css internet-explorer-11


【解决方案1】:

使用正确的类型。

&lt;link type="text/css" rel="stylesheet" href="yourLink"&gt;

【讨论】:

  • 这就是我所做的,问题仍然存在。
  • 您的链接可能也有问题....以/ 开头作为绝对路径
  • 测试您的路径是否正确复制并将href 传递到您的网址中
  • 就是这样!! IE11需要根斜线!谢谢!
  • 哈哈同意,我讨厌在 Web 开发过程中考虑到它。就好像你在幼儿园工作,有一个孩子……暗中让你想……请死在火里。对不起。我说了算。
【解决方案2】:

您需要将 type 属性的值从 "css/stylesheet" 更改为 "text/css"

【讨论】:

    【解决方案3】:

    请试试这种类型

    <head>
    <link rel="stylesheet" type="text/css" href="konsensusempfehlung.css" />
    </head>
    

    或者如果你只想定位到 IE,那么试试这个。

    <head>
    <!--[if IE]>
        <link rel="stylesheet" type="text/css" href="konsensusempfehlung.css" />
    <![endif]-->
    </head>
    

    让我知道进一步的澄清

    【讨论】:

    • 我如你所说缩短了 href 属性。结果:现在它在 IE11 和 Firefox 中不起作用。所以路径是正确的,就像我原来的帖子一样。
    【解决方案4】:

    应该在链接类型中使用text/css。还将 href 设置为 your link 。不过应该不是浏览器问题

    【讨论】:

    • 哦,抱歉,我确实将类型设置为“text/css”。我按照其他地方的建议删除了,但没有解决问题。将 href 设置为“您的链接”是什么意思?我确实将它设置为 TYPO3 后端中 css 的正确位置?
    • 尝试不指定类型。也许它会工作(P.S.接受编辑请)
    • 但我已经尝试删除 type 属性!并且缩短 href 属性也不是解决方案(见下文)。
    猜你喜欢
    • 1970-01-01
    • 2022-10-12
    • 2018-05-07
    • 2016-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-17
    • 1970-01-01
    相关资源
    最近更新 更多