HTML DOM minWidth 屬性
定義和用法
minWidth 屬性設置元素框的最小寬度。
語法:
Object.style.minWidth=length|%
可能的值
值 | 描述 |
---|---|
length | 定義元素的最小寬度值。 |
% | 定義基于其包含塊的百分比最小寬度。 |
實例
本例設置元素框的最小寬度:
<html>
<head>
<script type="text/javascript">
function setMinWidth()
{
document.getElementById("p1").style.minWidth="1000px";
}
</script>
</head>
<body>
<p id="p1">This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.</p>
<input type="button" onclick="setMinWidth()" value="Set min width" />
</body>
</html>