How can I put a vertical line down the center of a div?

后端 未结 8 1912
陌清茗
陌清茗 2020-12-24 00:59

How do I put a vertical line down the middle of a div? Maybe I should put two divs inside the div and put a left border on one and a right border on the other? I have a DIV

8条回答
  •  借酒劲吻你
    2020-12-24 01:43

    I think you need a wrapper div with a background image. If not, then you are not guaranteed to have the border go all the way from the top to the bottom.

    Float this one left
    float this one right

    *be sure to leave the space between the left and right for the image to show up.

    you'll need a style that looks like:

    .wrapper{background:url(img.jpg) 0 12px repeat-y;}
    

提交回复
热议问题