current position:Home>CSS sets the color of the small vertical bar in front of the title

CSS sets the color of the small vertical bar in front of the title

2022-04-29 07:42:16The so-called drunk alone

CSS Set the small vertical bar in front of the title

On the effect

 Insert picture description here

The small orange vertical bar, even if it achieves the effect, ha , The black next to it is a screenshot that has not been cut well reason

HTML Code

    <div class="recomend-list">
      <h2> Recommended song list </h2>
    </div>

CSS Code

.recomend-list h2 {
    
  position: relative;
  font-size: 18px;
  text-align: left;
  padding-left: 9px;
  height: 40px;
  line-height: 40px;
}
.recomend-list h2:before {
    
  position: absolute;
  content: "";
  background-color: #ec8537;
  width: 4px;
  height: 18px;
  left: 0;
  top: 50%;
  margin-top: -8px;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
}

o have to k

copyright notice
author[The so-called drunk alone],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204290540591796.html

Random recommended