Image border 屬性

定義和用法
border 屬性可設(shè)置或者返回圖片的 border 屬性值。
border 屬性指定了圖像周圍的邊框?qū)挾取?/p>
注意:默認(rèn)情況下圖片沒(méi)有邊框(除非圖片本身自帶了邊框)。
語(yǔ)法
imageObject.border=pixels
瀏覽器支持
所有主要瀏覽器都支持 border 屬性
實(shí)例
實(shí)例
添加圖片邊框:
<html>
<head>
<script>
function addBorder()
{
document.getElementById("compman").border="2";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<br><br>
<input type="button" onclick="addBorder()" value="Add border">
</body>
</html>
<head>
<script>
function addBorder()
{
document.getElementById("compman").border="2";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<br><br>
<input type="button" onclick="addBorder()" value="Add border">
</body>
</html>
嘗試一下 ?

更多建議: