Border-Color不见了


 

在编辑div的属性 style中的borderColor时,再取div.outerHTML却发现borderColor属性不见了,慢慢地,发现了多出了个border-right-color属性,想来,borderColor的设定应该是分散边框中了吧,

下面的应该可以看出结果来

  1. <html>
  2.     <body>
  3.     <DIV id="DIV_1" style="FONT-SIZE:18px; LEFT: 40px; OVERFLOW: hidden;  WIDTH:273px; COLOR: #FF00FF; FONT-FAMILY:Arial; POSITION: absolute; TOP: 40px; HEIGHT:45px; BORDER-WIDTH:1px; border-style:solid; BORDER-COLOR:#ff00ff; BACKGROUND-COLOR: #cccccc; TEXT-ALIGN: left" type="rectangle">
  4.                     <LABEL height="90%"  width="100%"/>
  5.                 </DIV>
  6.                 <DIV id="DIV_2" style="BORDER-RIGHT: gray 0px solid; PADDING-RIGHT: 0px; BORDER-TOP: gray 0px solid; PADDING-LEFT: 0px; FONT-SIZE:14px; LEFT: 45px; PADDING-BOTTOM: 0px; OVERFLOW: hidden; BORDER-LEFT: gray 0px solid; WIDTH: 61px; COLOR:black; PADDING-TOP: 0px; BORDER-BOTTOM: gray 0px solid; FONT-FAMILY:Arial; POSITION: absolute; TOP: 40px; HEIGHT:24px; border-style:solid; BORDER-COLOR:#ff00ff; BACKGROUND-COLOR: #808080; TEXT-ALIGN: left" type="staticText">
  7.                     <LABEL height="100%"  name="text"  width="100%">Text</LABEL>
  8.                 </DIV>
  9.                 <button onclick="adiv()" >OK</button>
  10.                 <button onclick="chgColor()">chg Color</button>
  11.                 <button onclick="showHtml()">showHtml</button>
  12.                 <script type="">
  13.                     function adiv(){
  14.                         alert(DIV_1.style.borderColor);
  15.                     }
  16.                     
  17.                     function chgColor(){
  18.                         //adiv();
  19.                         DIV_1.style.borderColor ='#003402';
  20.                         DIV_1.style.backgroundColor ='#003f23';
  21.                     }
  22.                     
  23.                     function showHtml(){
  24.                          var htm = DIV_1.outerHTML;
  25.                          alert(htm);
  26.                     }
  27.                 </script>
  28. </body>
  29. </html>

你可能感兴趣的:(Border-Color不见了)