Skip to main content
100%

Untitled

✓ Published0🌍 Public
AAdrian Tudorache
Last edited Jul 2, 2023
Created on Jul 2, 2023
Forked from HTML Starter

This example demonstrates how to dynamically size an SVG element based on the bounding box of a text label. The page creates a single horizontal line with a centered text annotation, then draws a rounded rectangle behind the text using the dimensions returned by `getBBox()`. The SVG’s width is updated to fit the text plus padding. The code relies on native DOM methods like `createElementNS` and DOM APIs such as `setAttribute` and `getBBox`, with no external visualization libraries.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes