首页 文章

<ul>的CSS样式在外部工作表中不起作用,但在内部工作

提问于
浏览
0

我有一个CSS样式的奇怪问题 . 虽然同一工作表中的其他样式有效,但此样式不起作用 . 我检查了外部工作表的路径,它没问题,然后我将ul {}样式代码放入内部工作表中,它也工作正常 .

This is html code: 

<!DOCTYPE html>
<html lang= "cs-cz">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Mr. Chapadlákovo podvodní království</title>

    <link rel="stylesheet" type="text/css" href="css/layout.css">
    <link rel="stylesheet" type="text/css" href="css/textstyle.css">
</head>
<body>
 <!--NAVBAR-->   
<ul>
  <li><a href="#Lorem" id="fontNavbar">Království</a></li>
  <li><a href="#lorem" id="fontNavbar">LOREM</a></li>
  <li><a href="#lorem" id="fontNavbar">LOREM</a></li>
  <li><a href="#lorem" id="fontNavbar">LOREM</a></li>
  <li><a href="#lorem" id="fontNavbar">LOREM</a></li>
  <li><a href="#Kontakt" id="fontNavbar">Kontakt</a></li>
</ul>
</body>

我把它切到最大,看是否有任何碰撞:

body {
  background-color: rgb(20, 20, 20);
  background-attachment: scroll;
};

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
};

li a {
  display: inline-block;
  width: 7vw;
};

1 回答

  • 0

    去掉 ”;”在css文件中

    body {
      background-color: rgb(20, 20, 20);
      background-attachment: scroll;
    }
    
    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: row;
    }
    
    li a {
      display: inline-block;
      width: 7vw;
    }
    

相关问题