1

Please tell me how to remove background white color and worked horizontal line with words in the middle with css.

This is my code please check.

.asses {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #b7d9eb;
    line-height: 0.1em;
    margin: 10px 0 20px;
}

.asses span {
    background: #fff;
    padding: 0 10px;
    font-size: 43px;
    font-family: 'lato';
    color: #555555;
}
<h2 class="asses">
    <span>My TEXT HERE</span>
</h2>

So now please tell me how to solve that issue

demo
  • 6,038
  • 19
  • 75
  • 149

1 Answers1

2

Try this

h2 {
  font: 33px sans-serif;
  margin-top: 30px;
  text-align: center;
  text-transform: uppercase;
}


h2.asses {
  position: relative;
  overflow: hidden;
}

h2.asses span {
  display: inline-block;
  vertical-align: baseline;
  zoom: 1;
  *display: inline;
  *vertical-align: auto;
  position: relative;
  padding: 0 20px;
}

h2.asses span:before,
h2.asses span:after {
  content: '';
  display: block;
  width: 1000px;
  position: absolute;
  top: 0.73em;
  border-top: 1px solid red;
}

h2.asses span:before {
  right: 100%;
}

h2.asses span:after {
  left: 100%;
}
<h2 class="asses"><span>My TEXT HERE</span></h2>

Refer this link Line behind text for more examples

Gautam Naik
  • 8,990
  • 3
  • 27
  • 42