JavaScript DHTML/Style Layout/Border

Материал из Web эксперт
Перейти к: навигация, поиск

Border Color Dark Example

   <source lang="html4strict">

   

<html> <body>

Contents of the cell

<button onclick="myTable.borderColor="mediumblue";">Add color to the border</button> <button onclick="myTable.borderColorDark="blue";">Border color dark</button> <button onclick="myTable.borderColorLight="skyblue";">Border color light</button> </body> </html>


 </source>
   
  


Border Color Example

   <source lang="html4strict">

   

<html> <body>

Contents of the cell

<button onclick="myTable.borderColor="mediumblue";">Add color to the border</button> <button onclick="myTable.borderColorDark="blue";">Border color dark</button> <button onclick="myTable.borderColorLight="skyblue";">Border color light</button> </body> </html>


 </source>
   
  


Border Color Light Example

   <source lang="html4strict">

   

<html> <body>

Contents of the cell

<button onclick="myTable.borderColor="mediumblue";">Add color to the border</button> <button onclick="myTable.borderColorDark="blue";">Border color dark</button> <button onclick="myTable.borderColorLight="skyblue";">Border color light</button> </body> </html>


 </source>
   
  


"border" Example

   <source lang="html4strict">

   

<html> <body> <img id="myImage" src="http://www.wbex.ru/style/logo.png"> <button onclick="myImage.border = 15;">Add a border</button> <button onclick="myImage.border = 0;">Remove border</button> </body> </html>


 </source>
   
  


div.style.border="3px dashed #ff0";

   <source lang="html4strict">
 

<html> <head> <title>PrettyPretty</title> <script type="text/javascript"> document.onclick=changeElement; function changeElement() {

 var div = document.getElementById("div1");
 div.style.backgroundColor="#00f";
 div.style.width="500px";
 div.style.color="#fff";
 div.style.height="200px";
 div.style.paddingLeft="50px";
 div.style.paddingTop="50px";
 div.style.fontFamily="Verdana";
 div.style.fontSize="2em";
 div.style.border="3px dashed #ff0";
 div.style.position="absolute";
 div.style.left="200px";
 div.style.top="100px";
 div.style.textDecoration="underline";

} </script> </head> <body>

This is a DIV element. Click me to see the change.

</body> </html>


 </source>