HTML DOM लिंक आकार गुण लिंक तत्व के आकार विशेषता का मान लौटाता है।
नोट − आकार की संपत्ति का उपयोग केवल तभी किया जाता है जब rel गुण 'आइकन' . पर सेट हो
सिंटैक्स
निम्नलिखित वाक्य रचना है -
लौटने वाले आकार विशेषता मान
linkObject.sizes
उदाहरण
आइए लिंक रिले . के लिए एक उदाहरण देखें संपत्ति -
<!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;
} आउटपुट
यह निम्नलिखित आउटपुट देगा -
