Image hspace 屬性

定義和用法
hspace 屬性可設(shè)置或者返回圖片的 hspace 屬性值。
hspace 屬性指定圖像的左邊緣和右邊緣的空白。
語法
imageObject.hspace=pixels
瀏覽器支持
所有主要瀏覽器都支持 hspace 屬性
實(shí)例
實(shí)例
下面的例子將設(shè)置圖像的 hspace 和 vspace 屬性:
<html>
<head>
<script>
function setSpace()
{
document.getElementById("compman").hspace="50";
document.getElementById("compman").vspace="50";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<p>Some text. Some text. Some text. Some text.</p>
<input type="button" onclick="setSpace()" value="Set hspace and vspace">
</body>
</html>
<head>
<script>
function setSpace()
{
document.getElementById("compman").hspace="50";
document.getElementById("compman").vspace="50";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<p>Some text. Some text. Some text. Some text.</p>
<input type="button" onclick="setSpace()" value="Set hspace and vspace">
</body>
</html>
嘗試一下 ?

更多建議: