SVG (Scalable Vector Graphics).
SVG is XML-based vector graphics you place with <svg>
in the page. It scales crisply at any size, is accessible/semantic, and individual shapes (like <rect>
, <circle>
, <path>
, <text>
) are DOM elements you can style with CSS and manipulate with JS. Key attributes include viewBox
, width
, height
, fill
, stroke
, stroke-width
. SVG is great for icons, charts, logos, and interactive diagrams.
Entities (displaying reserved characters).
To show characters that HTML normally interprets, use entities:<
→ <
, &amp;gt;
→ >
, &amp;amp;
→ &
, &amp;quot;
→ "
, &amp;apos;
→ '
, &amp;nbsp;
→ non-breaking space.
Named entities and numeric ones (like &amp;#169;
) both work.
<center> (deprecated).&lt;center&gt;
is obsolete. Center using CSS: text with text-align: center;
, blocks with margin: 0 auto;
, or modern layout (Flex/Grid).
HTML5 Drag and Drop.
Enable by setting draggable="true"
on an element and listening for dragstart
. Allow drops by preventing default in dragover
. Use the DataTransfer
API inside events to setData
during dragstart
and getData
in drop
. Typical events: dragstart
, dragover
, drop
, plus dragenter
, dragleave
, dragend
.