我正在创建一个垂直分隔线,工作正常.但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>
结果是:
如何整理HTML和CSS?
解决方法
.headerDivider { border-left:1px solid #38546d; border-right:1px solid #16222c; height:80px; position:absolute; right:249px; top:10px; } <div class="headerDivider"></div>