How to create a line in the middle of the text, the line must occupy the entire length of the div? Like this, the parentheses indicate the start and the end of div:
[Text ------------------ Text]
How to create a line in the middle of the text, the line must occupy the entire length of the div? Like this, the parentheses indicate the start and the end of div:
[Text ------------------ Text]
using psuedo elements, see that Working Fiddle
HTML:
<div><span>Left</span><span class="right">Right</span></div>
CSS:
span
{
background-color: white;
}
.right
{
float: right;
}
div
{
position: relative;
}
div:before
{
content: '';
display: block;
width: 100%;
border-top: 1px solid black;
position: absolute;
bottom: 50%;
z-index: -1;
}
You can apply padding: 0 15px;
on the span
for better result..