如何使用CSS绘制一个垂直的,虚线向下的页面中心的页面? [英] How to draw a vertical, dotted line down center of page using CSS?

查看:638
本文介绍了如何使用CSS绘制一个垂直的,虚线向下的页面中心的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想绘制一条虚线,沿着我的页面的中心垂直向下,隐藏在任何内容框下面...有一个技术,在CSS中这样做,否则我必须使用重复的图片?

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?

推荐答案

这会给你点: 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*/
}

很漂亮。

这篇关于如何使用CSS绘制一个垂直的,虚线向下的页面中心的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆