垂直分隔线CSS

时间:2011-01-12 23:49:19

标签: html css

我正在创建一个垂直分隔线,工作正常。但CSS很麻烦。

CSS是:

.headerDivider1 {
border-left:1px solid #38546d;height:80px;position:absolute;right:250px;top:10px;
}

.headerDivider2 {
border-left:1px solid #16222c;height:80px;position:absolute;right:249px;top:10px;
}

HTML是:

<div class="headerDivider1"></div><div class="headerDivider2"></div>

结果是:

alt text

我怎样才能整理HTML和CSS?

2 个答案:

答案 0 :(得分:60)

.headerDivider {
     border-left:1px solid #38546d; 
     border-right:1px solid #16222c; 
     height:80px;
     position:absolute;
     right:249px;
     top:10px; 
}

<div class="headerDivider"></div>

答案 1 :(得分:5)

<div class="headerdivider"></div>

.headerdivider {
    border-left: 1px solid #38546d;
    background: #16222c;
    width: 1px;
    height: 80px;
    position: absolute;
    right: 250px;
    top: 10px;
}