2014-01-06 85 views
0

我需要在我的頁面上畫一條垂直線,並且無法使用任何種類的hr樣式標籤。即使它來了,我不能只是長度,我該怎麼做。如何在html或jsp頁面中包含長垂直線?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
<title>Homepage</title> 
</head> 
<LINK href="styling.css" rel="stylesheet" type="text/css"> 
<body> 
<img src="C:\virclipse\first.png" width="1050" height="150"> 
<br> 
<br> 
<br> 
<div align="center"> 
<font face="Algerian" size="6">WELCOME TO V-LAUNCHPAD</font> 
</div> 
<hr size=6 color="black"> 
<div id= "abc" style="margin: -10px 0px 0px 200px;"> 
</div> 
</body> 
</html> 


css stylesheet 

@CHARSET "ISO-8859-1"; 
#abc{ 
    width: 6px; 
    background-color: black; 
    height: 5000%; 
    float: left; 


} 
+1

試試這個http://jsfiddle.net/9t3sn/3/ – Karuppiah

回答

2

考慮使用div0px的寬度,並與邊框您選擇的高度:

<style> 
    .vertical-line { 
     width: 0; 
     border: 1px solid green; 
     height: 400px 
    } 
</style> 
<div class="vertical-line"></div> 

hrby definition應該是一個水平線

+0

thankyou sooooooooooooooooooooooo它的工作:) :) – Shine

+0

@ user3045921考慮接受我的答案,如果它爲你工作。 –

1

,如果你使用的HTML標籤<hr>希望verticle線應設置寬度和尺寸在<hr>標籤

<hr width="1" size="200" /> 

Demo here

+0

您看到演示的鏈接正在工作,我的意思是當我將值更改爲800,但相同的HTML不工作時,垂直線的長度正在增加。 – Shine

+0

從HTML5開始,''width'和'size'屬性[


'元素](http://dev.w3.org/html5/markup/hr.html)不受支持。 – ajp15243