18910140161

HTML-悬停时按钮底部边框消失-堆栈溢出

顺晟科技

2022-10-19 12:18:56

3

出于某种原因,我的按钮的底部边框在悬停时消失了,我不知道为什么。它在本地工作得很好,但当我实时检查我的站点时,它就消失了。

以下是我的代码https://Codepen.io/ecanada138/pen/exxrxow,这是我的回购的确切代码。

以下是网站https://8thvisionmedia.netlify.app/,您可以在这里看到问题,但它不显示在CodePen或本地


顺晟科技:

我不知道确切的原因,但是改变“scale”值可以解决问题:

@font-face {
  font-family: cocogoose-regular;
  src: url('../fonts/Cocogoose-Classic-Medium-trial.ttf');
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
}

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.5;
}

.navbar-nav a {
  list-style-type: none;
  text-align: center;
  display: inline-block;
  margin: 0px;
  padding: 0px 10px 0px 10px;
  border-right: 1px solid rgb(255, 255, 255);
  height: 20px;
}

.vimeo-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* pointer-events: none; */
  overflow: hidden;
}

.vimeo-wrapper iframe {
  width: 100vw;
  height: 56.25vw;
  /* Given a 16:9 aspect ratio, 9/16*100 = 56.25 */
  min-height: 100vh;
  min-width: 177.77vh;
  /* Given a 16:9 aspect ratio, 16/9*100 = 177.77 */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* z-index: -1; */
}

.phone-nav {
  display: none;
}

.navbar-nav {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  color: rgb(255, 255, 255);
  font-size: 1rem;
}

.navbar-toggler:focus {
  text-decoration: none;
  outline: 0;
  box-shadow: 0 0 0 0.1rem;
  border: 1px solid rgb(255, 255, 255);
}

.custom-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255, 1.0)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}

.navbar-toggler:focus {
  box-shadow: none;
}

.desktop-nav-container {
  flex-direction: row;
  justify-content: center;
}


/* .nav-link-desktop::after{
  content: '  |';
} */

@media screen and (max-width: 992px) {
  .phone-nav {
    display: block;
  }
}

.home-container {
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: rgb(255, 255, 255);
}

.home-row {
  padding: 0 10rem 0 10rem;
  z-index: 1000;
}

.home-text {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 3px;
}

.home-col {
  width: 100%;
}

.col-logo {
  position: absolute;
  left: 2rem;
  bottom: 1rem;
  margin-bottom: 0.5rem;
  padding: 0;
}

.row-copyright {
  position: absolute;
  right: 2rem;
  bottom: 1rem;
  font-family: 'Montserrat', sans-serif;
}

.vision-media-logo {
  width: 3rem;
}

a {
  color: rgb(255, 255, 255) !important;
  font-size: 14px;
}

.fa {
  font-size: 2rem;
}

ul {
  text-align: center;
}

@media screen and (min-width: 1399px) {
  .home-row {
    padding: 0 20rem 0 20rem;
  }
}

@media screen and (min-width: 1800px) {
  .home-row {
    padding: 0 35rem 0 35rem;
  }
}

@media screen and (min-width: 2200px) {
  .home-row {
    padding: 0 50rem 0 50rem;
  }
}

@media screen and (max-width: 767px) {
  .navbar-nav {
    margin-right: 0;
  }
  .home-row {
    padding: 0 3rem 0 3rem;
  }
}

@media screen and (max-width: 575px) {
  .home-row {
    padding: 0 1rem 0 1rem;
    margin-top: -8rem;
  }
  .home-text {
    font-size: 1rem;
  }
  .vision-media-logo {
    width: 2rem;
  }
  .col-logo {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
  }
  .row-copyright {
    position: absolute;
    right: 1rem;
    bottom: 0rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
  }
}


/* .myIcon {
  margin-left: 3rem;
  margin-right: 3rem;
}

.hide {
  visibility: hidden;
  font-size: 1rem;
  margin-top: 10px;
  opacity: 0;
  text-transform: uppercase;
  text-align: center;
  transition: 0.8s;
}

.myIcon:hover .hide {
  visibility: visible;
  opacity: 1;
}

.myIcon {
  z-index: 1000;
}
*/

@media screen and (max-width: 576px) {
  .vimeo-wrapper {
    background-image: url('../images/home-screen-bg.jpg');
    background-position: center;
    background-size: cover;
  }
  .vimeo-wrapper iframe {
    display: none;
  }
  .phone-container {
    position: relative;
  }
}

@media screen and (max-width: 515px) {
  .fa-col {
    display: flex;
    flex-direction: row;
  }
}

@media screen and (min-width: 992px) {
  .navbar-expand-lg .navbar-nav .nav-link {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
  .desktop-nav-container {
    display: none !important;
  }
}

.col-copyright {
  margin-bottom: 1rem;
}

@media screen and (max-width: 992px) {
  .navbar-nav a {
    list-style-type: none;
    text-align: center;
    display: inline-block;
    margin: 0px;
    padding: 0.5rem 1rem;
    border: none;
    height: 100%;
    font-size: 1rem;
  }
}

.create-button {
  background-color: rgba(255, 255, 255, 0);
  color: rgb(255, 255, 255);
  outline: 0;
  border: 1px solid rgb(255, 255, 255) !important;
  border-bottom: 1px solid rgb(255, 255, 255) !important;
  font-family: 'cocogoose-regular';
  letter-spacing: 2px;
  margin: auto;
  padding: 1rem 2rem;
  text-align: center;
  text-decoration: none;
  transition: 0.5s ease;
}

.create-button a {
  text-decoration: none;
}

.create-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  /* color: rgb(255, 255, 255); */
  /* outline: 0; */
  /* border: 1px solid rgb(255, 255, 255); */
  /* font-family: 'cocogoose-regular'; */
  /* letter-spacing: 2px; */
  /* width: 100%; */
  /* padding: 1rem 2rem; */
  transform: scale(1.1);
}

移除变换:尺度(1.1); 成功了

它在Firefox上运行良好。但我看到这个问题很紧张。并通过向类中添加填充来解决它。

添加以下内容,它应该可以正常工作:

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航