如何从此圆形图标删除黑色边框?

时间:2019-08-05 06:06:06

标签: html css

鼠标悬停可将背景更改为黑色,但我想删除黑色边框,并将图标显示为圆圈。

.our-activity-div {
  padding: 20px;
  text-align: center;
}

.our-activity-inner {
  width: 33%;
  box-sizing: border-box;
  display: inline-block;
}

.fundraising {
  max-width: 75%;
  min-height: 220px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  text-align: center;
  border-radius: 10px;
  margin: 0 auto;
  line-height: 0px;
  padding: 30px 35px;
  box-sizing: border-box;
}

.fundraise-hr {
  width: 25%;
  border-color: #000;
}

.fundraise-padding {
  text-align: left;
  padding-top: 20px;
}

.fundraising-parag {
  padding: 10px 5px;
  line-height: 1.5em;
}

.symbol0 {
  color: #000;
  font-size: 100px;
  position: relative;
  top: -28px;
  border-radius: 50%;
}

.fundraising:hover .fundraise-padding {
  color: #01d262;
}

.fundraising:hover .fundraise-hr {
  border-color: #01d262;
}

.fundraising:hover .symbol0 {
  background-color: #000;
  color: #01d262;
}
<div class="our-activity-div">
  <div class="our-activity-inner">
    <div class="fundraising">
      <span class="symbol0">&#9775;</span>
      <h2 class="fundraise-padding ">Fundraising</h2>
      <hr class="fundraise-hr "></hr>
      <p class="fundraising-parag">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
      </p>
    </div>
  </div>
</div>

3 个答案:

答案 0 :(得分:0)

从.fundraising:hover .symbol0中的CSS中删除背景色

并在:after上将pseudo element用作:hover并设置演示背景

.our-activity-div {
  padding: 20px;
  text-align: center;
}

.our-activity-inner {
  width: 33%;
  box-sizing: border-box;
  display: inline-block;
}

.fundraising {
  max-width: 75%;
  min-height: 220px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  text-align: center;
  border-radius: 10px;
  margin: 0 auto;
  line-height: 0px;
  padding: 30px 35px;
  box-sizing: border-box;
}

.fundraise-hr {
  width: 25%;
  border-color: #000;
}

.fundraise-padding {
  text-align: left;
  padding-top: 20px;
}

.fundraising-parag {
  padding: 10px 5px;
  line-height: 1.5em;
}

.symbol0 {
  color: #000;
  font-size: 100px;
  position: relative;
  top: -28px;
  border-radius: 50%;
}

.fundraising:hover .fundraise-padding {
  color: #01d262;
}

.fundraising:hover .fundraise-hr {
  border-color: #01d262;
}

.fundraising:hover .symbol0 {
  color: #01d262;
}

.fundraising:hover .symbol0:after {
  content: '';
  background-color: #000;
  position: absolute;
  width: 80%;
  height: 50%;
  top: 24px;
  z-index: -1;
  left: 9px;
  border-radius: 50%;
}
<div class="our-activity-div">
  <div class="our-activity-inner">
    <div class="fundraising">
      <span class="symbol0">&#9775;</span>
      <h2 class="fundraise-padding ">Fundraising</h2>
      <hr class="fundraise-hr "></hr>
      <p class="fundraising-parag">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
      </p>
    </div>
  </div>
</div>

答案 1 :(得分:0)

尝试跟随CSS

span.symbol0:hover {
    background: none !important;
}

答案 2 :(得分:0)

删除以下代码中的背景色:

.fundraising:hover .symbol0 {
  background-color: #000;
  color: #01d262;
}