那就再用一个hr,把颜色设置为和背景一样就看不出来是两个HR了:))

解决方案 »

  1.   

    IE6下最大100px!
    如果是背景色,用div就好了,干嘛用hr?!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <hr id="hrTest" color="red" style="height: 10px;" />
        <input type="button" id="btnAdd" value="Add" />
        <script type="text/javascript">
        <!--
    btnAdd.onclick = function()
    {
        hrTest.style.height = parseInt(hrTest.style.height) + 10;
        this.value = "hrTest.size is " + hrTest.style.height;
    };
        //-->
        </script>
    </body>
    </html>
      

  2.   

    看来是不行了,用尽方法也不行,原来我的目的是设置一个绝对定位用的。例如:<span>
    <div>
    <hr/>
    <ul>xxxxxxxxxxxxxxxxxx</ul>
    </div>
    </span>为了代码好看,那个hr换其它的都不能和div对齐,只有<hr/>或者<br/>,其它<a></a>或<p></p>都太长,所以只能用hr,哈,我也试了如yixianggao所说最大只能是100px高度,所以才觉得这个怪,想看看有没方法解决。刚才直接把hr不要,在JS里添加一个其它标签,这样代码又好看又实用了,昨晚没想到用这方法。
      

  3.   

    什么东西不能对齐:
    <span> 
    <div style="border:solid 1px black;"> 
    <hr/>
    <span style="display:block;border:solid 1px black;">d</span> 
    <ul> xxxxxxxxxxxxxxxxxx </ul> 
    </div> 
    </span> 
      

  4.   

    我的本意是想代码对齐,所以才用那个hr。<div>
    <hr/>这两个就对齐了,很公正的对齐,都是5列,哈,只是我自己BT点,为了好看才用那个hr。现在改成了
    <span> 
    <div>  
    <ul>xxxxxxxxxxxxxxxxxx </ul> 
    </div> 
    </span>
    更公整了,哈。