html - CSS(选择器)在 WAMP 服务器 (W10) 上不工作

标签 html css localhost wamp

我有很多时间忙于学习 HTML,我决定制作 wamp 服务器。一切顺利,我开始编写 HTML 代码。但是当我开始编写 CSS 代码时,选择器将不会显示在我本地域 (rolfweb.net:8080) 的网页中。但在 localhost 中它正确显示了所有 CSS! 代码:

<DOCTYPE html>
<html>
<head>
    <title> RolfWeb </title>

</head>
<body>
<link type="text/css" rel="stylesheet" href="/css/indexss.css"/>
    <nav>
        <ul>
            <li> Home </li>
            <li> Video's </li>
            <li> Games </li>
            <li> Contact en informatie </li>
            <li> Over mij </li>
        </ul>
    </nav>
    <p> Test </p>
    <footer>
    </footer>
</body>
</html>

还有 CSS:

p {
    color: blue;
}
/* This is not working! */
nav ul {
    list-style-type: none;
    background-color: #3f875f;
    border: 3px solid #3a756c;
    text-align: center;
}

因此它在 localhost 上显示良好,但在 rolfweb.net:8080 上显示不正常。

PS:抱歉我的英语不好,我是荷兰人 :P

最佳答案

在 head 标签内移动你的 css 链接:-

<DOCTYPE html>
<html>
<head>
<title> RolfWeb </title>
<link type="text/css" rel="stylesheet" href="/css/indexss.css"/>
</head>
<body>
  <nav>
    <ul>
        <li> Home </li>
        <li> Video's </li>
        <li> Games </li>
        <li> Contact en informatie </li>
        <li> Over mij </li>
    </ul>
</nav>
<p> Test </p>
<footer>
</footer>

关于html - CSS(选择器)在 WAMP 服务器 (W10) 上不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40074483/

相关文章:

javascript - 为什么 WebRTC 本地流没有显示?

jquery - 我可以使用 contenteditable div 代替 textarea 吗?

css - 在 chrome 上部署为云服务时 jssor slider 的奇怪行为

https - Opera - 链接脚本未从本地主机加载

javascript - MYSQL 数据插入查询不起作用

html - 具有内联样式的 CSS 特异性

python - forms.py 中的 Django 类型错误

html - 在不启用视频控件的情况下双击进入全屏 (WordPress/HTML5)

javascript - 使用http服务时访问xampp本地主机文件

在本地主机上开发 Facebook