Border-Color不见了

来源:互联网 发布:住校必备物品知乎 编辑:程序博客网 时间:2024/05/05 15:46


 

在编辑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>
原创粉丝点击