将鼠标悬停在按钮上后可摆动的段落和h2

时间:2018-07-31 16:53:52

标签: html css

当我将鼠标悬停在按钮上时,H2和段落摆动。我该如何预防?如您所见,我想在悬停时添加更多边框。是这种情况的原因吗?

enter image description here

.about-me-wrapper {
  background-color: #fff;
  width: 50%;
  margin: 10em auto;
  height: 50%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.about-me-wrapper p {
  width: 70%;
  line-height: 1.75;
}

.about-me-wrapper a {
  background: transparent;
  border: 2px solid #000;
  padding: 10px 20px;
  margin: 20px 0;
  font-weight: 700;
  text-transform: uppercase;
  transition: all .4s;
  display: inline-block;
}

.about-me-wrapper a:hover {
  cursor: pointer;
  border: 3px solid #4EADFF;
  color: #4EADFF;
  transform: scale(1.1);
}
<section class="about-me">
  <div class="about-me-wrapper">
    <h2>Aarhus Lejerboliger</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
      dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    <a href="#">View project</a>
  </div>
</section>

0 个答案:

没有答案