Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert space at position in border line

I'm displaying a horizontal line using css :

.horizontalLineBottom {
    border-bottom:solid #6E6A6B;
    border-width:1px;
}

Can I space be insterted a specific position on this line ?

So

______________________________________________

becomes

______________________________             ___
like image 734
blue-sky Avatar asked Oct 06 '22 00:10

blue-sky


2 Answers

Another solution using border-width:

.line {
    width: 20px;
    height: 1px;
    padding: 0;
    border-width: 0 100px 0 150px;
    border-style: solid;
    border-color: red;
}

http://jsfiddle.net/dfsq/Uttxy/1/

like image 115
dfsq Avatar answered Oct 10 '22 02:10

dfsq


:after or :before psuedo class can help you. Like in this Fiddle:

div {
    width:100px;
    height:100px;
    border:1px solid #000;
    margin:50px;
    background:yellow;
    position:relative;
}
div:after {
    content: '';
    height:60px;
    width:1px;
    position:absolute;
    top:20px;
    left:-1px;
    background:yellow;
}
like image 37
Muhammad Talha Akbar Avatar answered Oct 10 '22 04:10

Muhammad Talha Akbar