HTML DOM 링크 크기 속성은 링크 요소의 크기 속성 값을 반환합니다.
참고 − 크기 속성은 rel 속성이 'icon'으로 설정된 경우에만 사용됩니다.
구문
다음은 구문입니다 -
크기 반환 속성 값
linkObject.sizes
예시
Link rel의 예를 살펴보겠습니다. 속성 -
<!DOCTYPE html>
<html>
<head>
<title>Link sizes</title>
<link id="extStyle" rel="icon" href="new.gif" sizes="10x10">
</head>
<body>
<form>
<fieldset>
<legend>Link-sizes</legend>
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var extStyle = document.getElementById("extStyle");
if(extStyle.sizes == '10x10')
divDisplay.textContent = 'The linked icon size: '+extStyle.sizes+' is not compatible';
else
divDisplay.textContent = 'Congrats! The linked icon size is compatible';
</script>
</body>
</html> 위의 예에서 'style.css' 포함 -
form {
width:70%;
margin: 0 auto;
text-align: center;
}
* {
padding: 2px;
margin:5px;
}
input[type="button"] {
border-radius: 10px;
} 출력
이것은 다음과 같은 출력을 생성합니다 -
