
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML onresize Event Attribute
The HTML onresize attribute is triggered when user resize the browser window.
Syntax
Following is the syntax −
<tagname onresize=”script”></tagname>
Let us see an example of HTML onresize event Attribute −
Example
<!DOCTYPE html> <html> <head> <style> body { color: #000; height: 100vh; background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat; padding: 20px; } </style> </head> <body onresize="resizeFn()"> <h1>HTML onresize Event Attribute Demo</h1> <p>Now resize the browser window</p> <script> function resizeFn() { document.body.style.background = 'linear-gradient(45deg, #8BC6EC 0%, #9599E2 100%) no-repeat'; } </script> </body> </html>
Output
Now resize the browser window to observe how onresize event attribute works.
- Related Articles
- HTML ononline Event Attribute
- HTML onpageshow Event Attribute
- HTML ondragend Event Attribute
- HTML ondragenter Event Attribute
- HTML ondragleave Event Attribute
- HTML ondrop Event Attribute
- HTML ondragstart Event Attribute
- HTML onmouseup Event Attribute
- HTML onmousedown Event Attribute
- HTML onmousemove Event Attribute
- HTML onmouseout Event Attribute
- HTML onmouseover Event Attribute
- HTML onhashchange Event Attribute
- HTML ondblclick Event Attribute
- HTML onblur Event Attribute

Advertisements