Home > front end >  How to remove <b> </b> tags from the html
How to remove <b> </b> tags from the html

Time:11-17

I was told they should not be in there, but how do I remove them?

https://jsfiddle.net/jqzs6d3o/

That is all I am doing in the code.

Removing the <b> </b> tags from the html it.

How would that be done?

Is this something hard to do?

Removing <b></b> removes the blue circle. I want to keep the circle and remove <b></b>

<button class="exitnew" type="button" aria-label="Close"><b></b></button>

.exitnew {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
  margin: auto;
  padding: 0;
  width: 48px;
  height: 48px;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 50%;
  clip-path: circle(50%);
  transition: all 1s ease;
  overflow: hidden;
}

.exitnew::before,
.exitnew::after {
  content: "";
  position: absolute;
  height: 5px;
  width: 38px;
  top: 22px;
  left: 5px;
  right: 5px;
  background: red;
  transform: rotate(45deg);
  transition: all 1s ease;
}

.exitnew::after {
  transform: rotate(-45deg);
}

.exitnew:hover {
  background: transparent;
}

.exitnew:hover::before,
.exitnew:hover::after {
  background: green;
}

.exitnew b {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 5px solid blue;
  border-radius: 50%;
}
<button class="exitnew" type="button" aria-label="Close"><b></b></button>
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

CodePudding user response:

Added some styles #circle ID and changed your positioning a bit of .exitnew Also made b display: none; Check the changes below.

.exitnew {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
  margin: auto;
  padding: 0;
  width: 48px;
  height: 48px;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 50%;
  clip-path: circle(50%);
  transition: all 1s ease;
  overflow: hidden;
}

.exitnew::before,
.exitnew::after {
  content: "";
  position: absolute;
  height: 5px;
  width: 38px;
  top: 17px;
  left: -1px;
  right: 5px;
  background: red;
  transform: rotate(45deg);
  transition: all 1s ease;
}

.exitnew::after {
  transform: rotate(-45deg);
}

.exitnew:hover {
  background: transparent;
}

.exitnew:hover::before,
.exitnew:hover::after {
  background: green;
}

.exitnew b {
  display: none;
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: 100%;
  border: 5px solid blue;
  border-radius: 50%;
}

#circle {
    background-color:#fff;
    border-width: 2rem;
    border:4px solid darkblue;    
    height:45px;
    border-radius:50%;
    -moz-border-radius:50%;
    -webkit-border-radius:50%;
    width: 45px;
    margin-left: 1rem;
    position: absolute;

}
<button class="exitnew" id="circle" type="button" aria-label="Close"><b></b></button>
<iframe name="sif2" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

CodePudding user response:

You can utilize the button itself as the circle. With this you’ll have cleaner code where you can just completely remove b tag without losing the circle.


.exitnew {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 40px;
  border: 5px solid blue;
  border-radius: 50%;
}

Here’s the changes I made. https://jsfiddle.net/Lnbuxvc0/

  • Related