Created
November 11, 2024 11:55
-
-
Save distums/ab1d135c711dbd771a1bd101fb87446f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>SVG viewBox Attribute</title> | |
| <style type="text/css"> | |
| svg { | |
| border: 1px solid #aaa; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- Without viewBox --> | |
| <svg width="200" height="200"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| <!-- With viewBox --> | |
| <svg width="200" height="200" viewBox="0 0 200 200"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| <svg width="200" height="200" viewBox="0 0 100 100"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| <svg width="200" height="200" viewBox="0 0 300 300"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| <svg width="200" height="200" viewBox="50 0 100 100"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| <svg width="200" height="200" viewBox="-50 0 100 100"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| <svg width="200" height="200" viewBox="0 50 100 100"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| <svg width="200" height="200" viewBox="0 -50 100 100"> | |
| <circle cx="50" cy="50" r="45" stroke="#000" stroke-width="3" fill="none" /> | |
| </svg> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.geeksforgeeks.org/svg-viewbox-attribute/