【问题标题】:How can I connect a .css-file to a wikipage where the html-code disappears when I save the page?如何将 .css 文件连接到保存页面时 html 代码消失的 wiki 页面?
【发布时间】:2019-08-19 12:52:17
【问题描述】:

我尝试将 wikipage 与 .css-file 连接起来,该 .css-file 作为附件包含在页面中。页面上的 html 代码是这样的:

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

没有成功,因为 html 代码消失了,只剩下代码 &lt;link/&gt;

我已经尝试将 wikipage 与 Sharepoint(数据库)中的 css 文件连接起来,但即使在我保存 wikipage 后href 命令仍然存在,这也没有成功。

剩下的 html 代码看起来像这样:

<link href="https://wiki/ksldsld.css" type="text/css"/>

如果有人知道一个好的解决方案,那就太好了。

【问题讨论】:

  • 你能和我们分享一些你的代码吗?
  • 您希望代码显示为页面上的文本(如您的问题中所示),还是要将其添加为样式表以改变页面的外观?跨度>
  • 如果你只是在样式标签后面添加css而不是链接到它会发生什么?
  • @RichardParnaby-King 我想将其添加为样式表,以便更改维基页面的设计(外观)。

标签: html css href wiki


【解决方案1】:

@Ralph 我尝试在 html 代码中添加 .css,如下所示:

<h1 dir="ltr">HELLO WORLD</h1>
<style type="text/css">
h1 {color: blue} 
</style>

但是在我保存维基页面后,标题“HELLO WORLD”仍然是黑色的,并且样式标签内的代码消失了,维基页面中只剩下这个代码:

<h1 dir="ltr">HELLO WORLD</h1>
<style type="text/css">
</style>

我真的不知道如何将样式表添加到维基页面并在代码消失时更改页面的外观,即使我将代码放在&lt;style&gt; 标记中...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-10
    • 2015-03-28
    • 2022-12-15
    • 2016-07-23
    • 1970-01-01
    • 2019-11-11
    • 2013-04-16
    • 1970-01-01
    相关资源
    最近更新 更多