首页 > 解决方案 > 我似乎无法弄清楚我做错了什么,我的悬停在我的网站上不起作用

问题描述

在我的网站上:总部

似乎存在一个问题,如果您尝试将鼠标悬停在顶部的文件下方,您将无法将鼠标悬停在图像上以转到链接。但是,如果您尝试视频的底部部分,您也可以。我做错了什么?我目前正在寻找答案。因此,如果有人可以提供帮助,我将不胜感激。我真的。我是菜鸟。我知道。哈哈。

顺便说一句,如果您将鼠标悬停在顶部的 WORDS 上,则有一个提示(对我来说这是一个提示),您可以单击。所以我想这就是我的线索。

请告诉我我能做些什么来让我的问题对任何人都有帮助,我是新手。

我试图查看我的 HTML 中是否拼写错误或遗漏了某些内容,我将继续使用我的 CSS

/* Projects section */

.projects-section {
  text-align: center;
  padding: 10rem 2rem;
  background: black;
}

.projects-section-header {
  max-width: 640px;
  margin: 0 auto 6rem auto;
  border-bottom: 0.2rem solid black;
}

@media (max-width: 28.75em) {
  .projects-section-header {
    font-size: 4rem;
  }
}

/* "Automagic" image grid using no media queries */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  grid-gap: 4rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  margin-bottom: 6rem;
}

@media (max-width: 30.625em) {
  .projects-section {
    padding: 6rem 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project {
  background: black;
  box-shadow: 1px 1px 2px rgb(255, 0, 0);
  border-radius: 13px;
}

.code {
  color: var(--main-white);
  transition: color 0.3s ease-out;
}

.project.code:hover {
  color: #00ff22;
}

.project-image {
  height: calc(100% - 6.8rem);
  width: 100%;
  object-fit: cover;
}

.project-title {
  font-size: 2rem;
  padding: 2rem 0.5rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 2px;
}

.btn-show-all {
  font-size: 2rem;
  background: black;
  transition: background 0.3s ease-out;
}

.btn-show-all:hover {
  background: red;;
}

.btn-show-all:hover > i {
  transform: translateX(2px);
}

.btn-show-all > i {
  margin-left: 10px;
  transform: translateX(0);
  transition: transform 0.3s ease-out;
}

标签: htmlcss

解决方案


<style>
.example {
width: 100%;
height: 300px;
background: #DDD;
}
.example:hover {
width: 88%;
height: 300px;
background: grey;
transform: translated(10px);
}
</style>
<div class="example">
<p> Just put your mouser here and watch it change! </p>
</div>

很简单,你只需要:hover一点!


推荐阅读