文字不会缩小分色

时间:2016-09-07 15:47:22

标签: html css

当观看者缩小此菜单设计时,我想减小文本的大小,但它不起作用。试过这里提出的一些建议,但我没有运气。

有人可以提供建议吗? TIA

这是小提琴:Demo

<div style="font-size:20px">
this text resizes when you zoon + or -
</div>
<div id="nav" style="display: inline-block, width: 100%;">
<ul id="nav">
<li><a href="#">Top Level Menu</a>
<ul>
<li class="first"><a href="#">Sub Level 1</a>
<ul>
<li class="first"><a href="#">Sub Level 2</a></li>
<li><a href="#">Sub Level 2</a></li>
<li class="last"><a href="#">Sub Level 2</a></li>
</ul>
</li>
<li class="last"><a href="#">Sub Level 1</a></li>
</ul>
</li>
</ul>
</div>

/* MAIN MENU */

#nav {
  margin-top: 0px;
  margin-right: auto;
  margin-left: auto;
  background-color: #222;
  text-align: center;
  font-family: Verdana, Helvetica, sans-serif;
}

#nav li {
  margin-top: 10px;
  line-height: 2px;
}

#nav li.last {
  border: none;
}

#nav a {
  text-align: left;
}

#nav ul {
  display: inline-block;
  margin-top: 0px;
  padding: 0 5px;
  border-radius: 5px;
  list-style: none;
}

#nav ul:after {
  display: block;
  visibility: hidden;
  clear: both;
  height: 0px;
  content: '.';
}

#nav ul li {
  position: relative;
  float: left;
  padding-bottom: 0px;
  border-right: 1px solid #444;
  line-height: 1px;
}

#nav ul li a {
  display: block;
  padding: 15px 17px 14px;
  color: #AAA;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 12px;
}

#nav ul li:hover > a {
  color: #FFF;
}

#nav ul li.active > a {
  color: #2980B9;
}


/* SUB MENU */

#nav ul li > ul:before {
  position: absolute;
  top: -9px;
  left: 120px;
  margin-bottom: -1px;
  padding-top: 10px;
  width: 0;
  height: 0;
  border-width: 0 9px 9px 9px;
  border-style: solid;
  border-color: transparent transparent #777 transparent;
  content: "";
}

#nav ul li > ul {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: -9999;
  visibility: hidden;
  margin-left: -130px;
  padding-top: 10px;
  width: 240px;
  background: none;
  opacity: 0;
}

#nav ul li:hover > ul {
  top: 95%;
  z-index: 100;
  display: block;
  visibility: visible;
  opacity: 1;
}

#nav ul li > ul li:first-child {
  padding-top: 3px;
  border-radius: 4px 4px 0 0;
}

#nav ul li > ul li:last-child {
  border-radius: 0 0 4px 4px;
}

#nav ul li > ul li {
  margin-top: 0px;
  margin-bottom: -5px;
  padding: 0 3px 3px;
  width: 100%;
  border: none;
  background: #777;
  -webkit-box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.4);

0 个答案:

没有答案