<ul>显示:表格在某些时候无效

时间:2017-04-14 19:15:31

标签: javascript html css html5 css3

我正在开发一个项目,我需要页面上的按钮大小相同。我得到了它的工作。但只有一些时间。如您所见,顶部按钮组的大小不同,但底部组的高度相同。除了底部在第三个按钮上有class="third"以及顶部有四个项目之外,各种HTML代码都是相同的。

我测试了,class="third"没有造成差异。

我唯一能想到的是,有4个按钮会导致高度停止工作。

&#13;
&#13;
body {
  background: #fff2e8;
}

* {
  margin: 0;
  font-family: 'Oxygen', sans-serif;
  font-size: 25px;
  line-height: 1.5;
  vertical-align: middle;
}

ul {
  display: table;
  padding: 0;
  width: 90%;
  margin: 5% auto;
  list-style-type: none;
  vertical-align: middle;
  height: 20vh;
}

li {
  display: block;
  float: left;
  vertical-align: middle;
  text-align: center;
  width: 50%;
  height: 100%;
  margin-top: 15px;
  margin-right: 0;
}

li#small {
  display: block;
  vertical-align: middle;
  text-align: center;
  width: 50%;
  height: 50%;
  margin-top: 15px;
  margin-right: auto;
  margin-left: auto;
}

li.third {
  vertical-align: middle;
  text-align: center;
  margin: auto;
  width: 50%;
}

.ghost-button {
  color: rgb(9, 82, 85);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgb(9, 82, 85);
  padding: 5px 5px;
  margin: auto;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.HP {
  display: inline-block;
  float: right;
  margin: 2% 5% 0 0;
  position: fixed;
  right: 5%;
  bottom: 2.5%;
}

.ghost-button:hover,
.ghost-button:active {
  color: #FFF;
  background-color: rgb(9, 82, 85);
  text-decoration: none;
}

a {
  text-decoration: none;
  color: rgb(9, 82, 85);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.third a {
  margin-left: 50%;
}
&#13;
<ul>
  <li><a class="ghost-button" href="S5A.php">Try
			calling the number listed on the document</a></li>
  <li><a class="ghost-button" href="S5B.php">Keep
			the document on your counter and wait until your daughter comes by to
			visit</a></li>
  <li><a class="ghost-button" href="S5C.php">Ignore
			the document</a></li>
  <li><a class="ghost-button" href="S5D.php">Ask
			Your Service Coordinator for Help</a></li>
</ul>
<ul>
<li><a class="ghost-button" href="S1A.php">Check the newspaper classifieds for affordable pieces </a></li>
<li><a class="ghost-button" href="S1B.php">Check for garage 
sales within walking distance </a></li>
<li class="third"><a class="ghost-button" href="S1C.php">Do 
nothing</a></li>
</ul>
&#13;
&#13;
&#13;

0 个答案:

没有答案