Paste space to a border position

I show a horizontal line using css:

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

Is it possible to touch the place in this line?

So

______________________________________________

becomes

______________________________             ___
+5
source share
7 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/

+3
source

:afteror :beforepsuedo 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;
}
+1
source

( ).

, .

0

CSS. 2 1) _ , , CSS. 2) , . margin

0

background : http://jsfiddle.net/q652t/ ,

.line {
    margin: 10px;
    height: 1px;
    width: 400px;
    background:  -webkit-linear-gradient(
        left, gray 10%, white 10%, white 40%, 
        gray 40%, gray 60%, 
        white 60%, white 80%,
        red 80%, red 100%);
}
0

, , . , .

.verticalLineBottom { 
  position: relative; 
  border-bottom: 1px solid #6E6A6B; 
}
.verticalLineBottom:after { 
  content: ""; 
  position: absolute; 
  right: 20px; 
  bottom: -1px; 
  width: 100px; 
  height: 1px; 
  background: #fff;
}

: http://jsfiddle.net/zxdS7/

, , .

0

, , .

.stopped-line {
  /* basic styles here */

  width: 100px; /* this is mandatory */
  position: relative;
}
.stopped-line:before {
  position: absolute;
  bottom: 0;
  display: block;
  width: 70%; /* width in percentage of the line */
  content: " ";
  height: 1px; /* thickness of the line */
  background: #000; /* color of the line */
}
.stopped-line:after {
  position: absolute;
  bottom: 0;
  left: 80%; /* Where should the second line start? */
  display: block;
  width: 20%; /* width in percentage of the line */
  content: " ";
  height: 1px; /* thickness of the line */
  background: #000; /* color of the line */
}

JSBin:

0

All Articles