tags:

views:

3219

answers:

9

I know there is a hr (horizontal rule) in html, but I don't believe there is a vr (vertical rule). Am I wrong and if not, why isn't there a vertical rule?

+3  A: 

There isn't, where would it go?

Use CSS to put a border-right on an element if you want something like that.

Chad Birch
A: 
OscarRyz
Why is this being downvoted?
ceejayoz
Because people don't think tables should be used for this (I didn't downvote).
erikkallen
A: 

HTML has little to no vertical positioning due to typographic nature of content layout. Vertical Rule just doesn't fit its semantics.

myroslav
+1  A: 

There in no vr in HTML however like Chad Birch said you can use other methods such as a css border on an element. Another method would be using an image, read up on it here.

teh_noob
+8  A: 

No, there is no vertical rule.

It does not make logical sense to have one. HTML is parsed sequentially, meaning you lay out your HTML code from top to bottom, left to right how you want it to appear from top to bottom, left to right (generally)

A vr tag does not follow that paradigm.

This is easy to do using CSS, however. Ex:

<div style="border-left:1px solid #000;height:500px"></div>

Note that you need to specify a height or fill the container with content.

Andy Baird
Tables can separate items vertically, so what you are saying is not the real reason there is no vr tag.
CiscoIPPhone
That wasn't why tables were added to the HTML spec. Tables are for displaying tabulated data. Almost any HTML element can be used to separate items vertically (anything you set to display:block and float:left with any height set)
Andy Baird
erf. I was trying to say that if things can already be separated vertically then how would adding a vr not follow HTMLs paradigm?
CiscoIPPhone
You may want to add "padding-left: 4px" to the style (with a suitable value of course).
lhf
A: 

you can do in 2 way :

1) create style as you already gave in div but change border-left ro border-right 2) take a image and make its width 1-2 px,

hope this will clear ur doubt...

thanks Romeo http://www.crazyfriendz.com

+1  A: 

How about:

writing-mode:tb-rl

Where top->bottom, right->left?

We will need vertical rule for this.

vscpp
That's a good point. However, it means rendering the page in an unconventional manner because you have to compete with all the other elements in the dom. Have you ever noticed that there are rendering differences between the browsers sometimes? ;) ~ Nonetheless, _very good point_.
drachenstern
A: 

You can make a vertical rule like this: <hr style="width: 1px; height: 20px; display: inline;">

matt
A: 

Try it and you will know yourself:

<body>
rokon<br />
rkn <hr style="width: 1px; height: 10px; display: inline; margin-left: 2px; margin-right: 2px;" />rockon<br />
rocks
</body>
</html>
muhammad rokonuzzaman