html - Is there a correct order to declaring border-width and border-style? -


i'm looking on page border-width on w3schools , says that:

note: declare border-style property before border-width property. element must have borders before can set width.

i'm trying find reference corroborates statement. seems declaring border-width before border-style works fine.

.demo {    width: 100px;    height: 100px;    margin: 10px auto;  }  .ten-red-solid {    border-width: 10px;    border-color: red;    border-style: solid;  }  .red {    border-color: red;  }  .ten {    border-width: 10px;  }  .solid {    border-style: solid;  }
<div class="ten-red-solid demo"></div>  <div class="ten red solid demo"></div>

this isn't true.

w3schools aren't official documentation source , therefore advice shouldn't taken seriously.

w3schools optimized learning, testing, , training. examples might simplified improve reading , basic understanding. tutorials, references, , examples reviewed avoid errors, but cannot warrant full correctness of content.

browsers evaluate styles once of them have been loaded, irrespective of order in declared.

for clarity following 2 styles identical:

div{    border-width:2px;    border-style:solid;    border-color:#000; }  div{    border-style:solid;    border-width:2px;    border-color:#000; } 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -