I just want a simple css and HTML to fix this issue.
Asked
Active
Viewed 71 times
-5

Pranav Totla
- 2,182
- 2
- 20
- 28

Abhi
- 21
- 3
-
refer: https://stackoverflow.com/questions/10829675/how-to-put-an-image-in-div-with-css – Santhosh Krishna May 17 '19 at 03:52
-
A simple way to do it could be like this -- https://jsfiddle.net/4yo1qhpf/5/ – Christopher Bennett May 17 '19 at 03:58
-
*to fix this issue* - what issue? – connexo May 17 '19 at 05:50
2 Answers
0
I hope this will help,
.heading{
display: block;
width: 100%;
position: relative;
text-align: center;
padding: 50px 0px;
}
.heading h2{
font-size: 25px;
color: #000;
text-align: center;
display: inline-block;
background-color: #fff;
width: 40%;
margin: auto;
}
.heading:before {
content: '';
position: absolute;
width: 100%;
height: 2px;
left: 0;
background: #000;
top: 50%;
z-index: -1;
}
<div class="heading">
<h2>Function</h2>
</div>

VISHAL SINGH
- 651
- 1
- 8
- 20
0
.wrapper{
position: relative;
text-align: center;
padding: 50px 0px;
}
.wrapper h2{
font-size: 24px;
color: #000;
text-align: center;
display: inline-block;
background-color: #fff;
padding: 0 30px;
margin: auto;
}
.wrapper:before {
content: '';
position: absolute;
width: 100%;
height: 2px;
left: 0;
background: #999;
top: 50%;
margin-top: -1px; /*this will keep this line vertically center to heading text*/
z-index: -1;
}
<div class="wrapper">
<h2>Functions</h2>
</div>

Atul Rajput
- 4,073
- 2
- 12
- 24