CSS边界合并

时间:2017-11-10 22:24:58

标签: html css

不幸的是,我从两个边框创建了一个向上箭头按钮 它没有合并在一起,所以我可以看到边框是如何堆叠的 彼此,但他们应该像一个元素一样!

#myBtn {
  //display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 999;
  border: 10px solid #778293;
  background-color: rgba(0, 0, 0, 0);
  border-left: none;
  border-top: none;
  cursor: pointer;
  width: 4vh;
  height: 4vh;
  transform: rotate(225deg);
  transition: border-width 150ms ease-in-out;
}

#myBtn:hover {
  border-bottom-width: 1em;
  border-right-width: 1em;
}
<button onclick="topFunction()" id="myBtn" title="Go to top">My Button</button>

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
#myBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 999;
  border: 10px solid #778293;
  background-color: rgba(0, 0, 0, 0);
  border-left: none;
  border-top: none;
  cursor: pointer;
  width: 4vh;
  height: 4vh;
  transform: rotate(225deg);
  transition: border-width 150ms ease-in-out;
}

#myBtn:hover {
  border-bottom-width: 1em;
  border-right-width: 1em;
}
&#13;
<button onclick="topFunction()" id="myBtn" title="Go to top">My Button</button>
&#13;
&#13;
&#13;