
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM linkSizes Property
The HTML DOM Link sizes property returns the value of the sizes attribute of link element.
NOTE − The sizes property is used only when rel property is set to ‘icon’
Syntax
Following is the syntax −
Returning sizes attribute value
linkObject.sizes
Example
Let us see an example for Link rel property −
<!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>
In the above example ‘style.css’ contains −
form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; }
Output
This will produce the following output −
Advertisements