CSS dashed border always appears white in IE8, why

2019-08-18 22:52发布

问题:

Here is the deal, I have following div with dashed borders:

.dashed-header {
    /*background-color: transparent;*/
    height: 87px;
    margin-top: 5px;
    border-top: 1px dashed #613e27;
    border-bottom: 1px dashed #613e27;
}

for some reason border is white instead of #613e27 and I have no idea why it is so? Here is my webpage You can see this border in dark brown header line.

回答1:

Try using:

border-color: #613e27 !important;


回答2:

I have IE8 and it work fine, I put it inside another div to see if the color disappear or not, but the color still exist

<style>
.main {
    height: 200px;
    width:200px;
    margin-top: 5px;
    border: 1px solid black;
    background-color:#A1Ae27;
    padding: 15px;
}
.dashed-header {
    /*background-color: transparent;*/
    height: 87px;
    width:100px;
    margin-top: 5px;
    border-top: 1px dashed #613e27;
    border-bottom: 1px dashed #613e27;
}
</style>
<body>

<div class="main">
    <div class="dashed-header">
    </div>
</div>
</body>

try to change to solid border and see does they appear whit too in your EI8?