Need to below type of functionality:
on the left text will be there and then a center line till last on right side.
Need to below type of functionality:
on the left text will be there and then a center line till last on right side.
Use the pseudo-element ::after
or even ::before
to make this side line. To make it easy, create a class to add in any head that you want.
/* your head */
h4.side-dashed {
/* mandatory */
display: table!important;
white-space: nowrap;
overflow: hidden;
/* depends of your style */
line-height: initial;
padding: 0px;
margin: 0p;
}
/* line */
h4.side-dashed:after {
content: '';
display: table-cell;
position: relative;
border-top: 1px solid #000000; /* color of the line */
top: 0.5rem; /* config if its too high or low */
width: 100%; /* size of the line */
left: 0.5rem; /* 'margin' of the line */
}
<h4 class="side-dashed">My Head</h4>
Here is one example how you can do it, with flex
:
.container{
display:flex;
flex-direction:row;
}
.populate{
display:flex;
flex-grow:1;
}
hr{
width:100%;
background-color:black;
margin-left:10px;
}
<div class="container">
<div>Hello Text</div>
<div class="populate"><hr></div>
</div>
kumar! I hope this should work.
h2 {
width: 100%;
text-align: left;
border-bottom: 0.2em solid #000;
line-height: 0.08em;
font-size: 15px;
}
h2 span {
background:#fff;
padding:0 5px;
}
<h2><span>Hello world!</span></h2>
How to do it:
h2 { /* Get element */
width: 100%; /* Full width */
text-align: left; /* float to left */
border-bottom: 0.2em solid #000; /* Add the black line */
line-height: 0.08em;
font-size: 15px; /* Font size */
}
h2 span { /* Get element's label */
background:#fff;
padding:0 5px; /* Add some padding */
}
<h2><span>Hello world!</span></h2>
1. 2. 3. 4. 5.
----------------------------------
1. Title
2. Span with elements
3. Text
4. Span end tag
5. Title end tag