I'd like to draw a dotted line, vertically down the center of my page, "hiding" under any content boxes along the way... Is there a technique to do this in CSS, or will I have to use a repeating image?
You can use border-left or border-right properties to make a vertical line. In order to determine the height of an element, the height property is used. In order to determine the position of a vertical line, using the position property.
How Do You Make A Line In Css? Adding hr> in your markup will allow you to add a horizontal line to the page. A browser draws a line along one of the top-side of a container, ranging from a child-sized element to the entire body.
Just simply add border-left: 5px solid rgb(128, 0, 17); to the div . services . Wrap anything you in a <div></div> and add a border to that wrapping <div></div> . This is the workflow you should follow.
This gives you dots: http://jsfiddle.net/NBMRp/
body:after {
content:"";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: 50%;
border-left: 2px dotted #444; /*change these values to suit your liking*/
}
They're just not that pretty.
For the dotted line i would use:
.vertical_dotted_line
{
border-left: 1px dotted black;
height: 100px;
}
<div class="vertical_dotted_line"></div>
And to make it under
other elements you need to play with the z-index
of your dotted line div and the other divs (they should have a higher value of z-index
)
If you wants the lines should extend out of div's height -
.dashed-lines:after {
content:"";
position: absolute;
z-index: -1;
top: -50px;
bottom: -50px;
left: 50%;
border-left: 2px dotted #ce9b3a;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With