开发者

How can we draw a vertical line in the webpage? [duplicate]

开发者 https://www.devze.com 2023-04-06 11:42 出处:网络
This question already has answers here: How to make a vertical line in HTML (26 answers) Closed 7 years ago.
This question already has answers here: How to make a vertical line in HTML (26 answers) Closed 7 years ago.

For horizontal it is <hr>. but for vert开发者_运维百科ical line?


You can use <hr> for a vertical line as well.
Set the width to 1 and the size(height) as long as you want.
I used 500 in my example(demo):

With <hr width="1" size="500">

DEMO


There are no vertical lines in html that you can use but you can fake one by absolutely positioning a div outside of your container with a top:0; and bottom:0; style.

Try this:

CSS

.vr {
    width:10px;
    background-color:#000;
    position:absolute;
    top:0;
    bottom:0;
    left:150px;
}

HTML

<div class="vr">&nbsp;</div>

Demo


That's no struts related problem but rather plain HMTL/CSS.

I'm not HTML or CSS expert, but I guess you could use a div with a border on the left or right side only.


<hr> is not from struts. It is just an HTML tag.

So, take a look here: http://www.microbion.co.uk/web/vertline.htm This link will give you a couple of tips.

0

精彩评论

暂无评论...
验证码 换一张
取 消