tags:

views:

163

answers:

6

Using Asp.net

I want to make a vertical line in my webpage...

How to make a vertical line in my webpage?

+5  A: 

There is no vertical equivalent to the <hr> element. However, one approach you may want to try is to use a simple border to the left or right of whatever you are separating:

<style type="text/css">
   #your_col {
      border-left: 1px solid black;
   }
</style>

<div id="your_col">
   Your content here
</div>
Daniel Vassallo
+7  A: 

Put a div around the markup where you want the line to appear to next and use CSS to style it:

<div class="verticalLine">

some other content

</div>

in css:

.verticalLine {
    border-left:thick solid #ff0000;
}
XIII
Thank you for separating style from content. ;)
drachenstern
+1  A: 

There isn't any tag to create a vertical line in HTML.

  1. Method: You load a line image. Then you set its style like "height: 100px ; width: 2px"

  2. Method: You can use <td> tags <td style="border-left: 1px solid red; padding: 5px;"> X </td>

Judas Imam
+1  A: 

There are many different ways to render a vertical line. More info would be needed to determine the best option and why.

CIDIC
+2  A: 

One other option is to use a 1-pixel image, and set the height - this option would allow you to float it to where you need to be.

Not the most elegant solution though.

chris
nothing wrong with this method, infact they use it on the jquery website
stephenmurdoch
A: 

This will add a vertical line.

 <div style="width:1px;height:200px;background-color:black;float:left;"></div>

Style the border as well if you want 3D look.

awe