Latest web development tutorials

HTML DOM 스타일 outlineWidth 속성

스타일 객체 참조 스타일 개체

정의 및 사용

outlineWidth 속성 집합 또는 프로필 주위의 요소의 폭을 돌려줍니다.

문법

outlineWidth 속성 설정 :

Object.style.outlineWidth="thin|medium|thick|length|inherit"

위로 outlineWidth 속성 :

Object.style.outlineWidth

描述
thin 定义细的轮廓。
medium 默认。定义中等的轮廓。
thick 定义粗的轮廓。
length 使用 px、cm 等单位定义轮廓的宽度。
inherit 轮廓的宽度从父元素继承。


브라우저 지원

Internet ExplorerFirefoxOperaGoogle ChromeSafari

모든 주요 브라우저는 outlineWidth 속성을 지원합니다.

참고 : IE7 및 이전 버전 outlineWidth 속성을 지원하지 않습니다.IE8은!의 DOCTYPE가 outlineWidth 속성을 지원합니다. IE9는 outlineWidth 속성을 지원합니다.


팁과주의 사항

주변 요소 주변의 등고선. 그것은 주변 요소의 여백에 표시됩니다. 그러나, 테두리 속성 다르다.

프로파일의 일부 요소의 크기없고, 따라서, 폭과 높이의 프로파일의 폭을 포함하지 않는 요소의 속성.


윤곽의 폭을 변경 :

<html>
<head>
<style type="text/css">
#ex1
{
border:1px solid red;
outline:green dotted thick;
}
</style>
<script>
function displayResult()
{
document.getElementById("ex1").style.outlineWidth="10px";
}
</script>
</head>
<body>

<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change outline width</button>

</body>
</html>

»시도


스타일 객체 참조 스타일 개체