简体   繁体   English

Sass导航嵌套不起作用

[英]Sass nav nesting not working

Using HTML5 nav element and nesting SASS properties. 使用HTML5 nav元素和嵌套SASS属性。 None of the properties are being applied to the html. 没有属性应用于html。 Not sure where the issue is. 不确定问题出在哪里。

Here is my sass: 这是我的sass:

nav{height:4em;width:100%;position:relative;padding:10px;z-index:1000;
  ul{list-style:none;}
  li{display:inline;font-size:130%;"
   a{color:#333;text-decoration:none; padding:5px;
    &:hover{border-bottom:#f8a593 2px solid;}
    &:active{border-bottom:#fd5d39 2px solid;}
}

And here is my html: 这是我的HTML:

  <nav>
    <ul>
       <li><a class="active-link" href="index.html">Home</a></li>
       <li><a href="work.html">Work</a></li>
       <li><a href="#.html">Le Me</a></li>
    </ul>
  </nav>

Isn't it because on that line: 不是因为在那条线上:

li{display:inline;font-size:130%;"

the latest character should be } , not " . Once I changed it, your code is compiled to: 最新的字符应该是} ,而不是 。一旦我更改了它,你的代码编译为:

nav {
  height: 4em;
  width: 100%;
  position: relative;
  padding: 10px;
  z-index: 1000; }
  nav ul {
    list-style: none; }
  nav li {
    display: inline;
    font-size: 130%; }
  nav li a {
    color: #333;
    text-decoration: none;
    padding: 5px; }
  nav:hover {
    border-bottom: #f8a593 2px solid; }
  nav:active {
    border-bottom: #fd5d39 2px solid; }

Is that what you want to achieve? 那是你想要实现的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM