Future
Supporting Other Elements
Several HTML elements have attributes that reflect a URL. These attributes are commonly used for linking resources, navigation, media, and metadata. Hereβs a list:
π Anchor & Navigation Elements
<a href="https://example.com">
βhref
: Specifies the hyperlink destination.<area href="https://example.com">
βhref
: Defines a hyperlink in an image map.<link href="https://example.com/style.css">
βhref
: Links external stylesheets, icons, etc.<base href="https://example.com/">
βhref
: Sets the base URL for relative links on the page.
πΌοΈ Media Elements
<img src="https://example.com/image.jpg">
βsrc
: Defines the image source.<audio src="https://example.com/audio.mp3">
βsrc
: Specifies the audio file location.<video src="https://example.com/video.mp4">
βsrc
: Specifies the video file location.<source src="https://example.com/media.mp4">
βsrc
: Used within<audio>
and<video>
elements.<track src="https://example.com/subtitles.vtt">
βsrc
: Specifies caption files for media.
π¬ Embedded & Interactive Content
<iframe src="https://example.com">
βsrc
: Embeds another web page.<embed src="https://example.com/animation.swf">
βsrc
: Embeds external content (e.g., Flash, PDFs).<object data="https://example.com/file.pdf">
βdata
: Specifies the URL of an external resource.
π Forms & Inputs
<form action="https://example.com/submit">
βaction
: Specifies where to send form data.<input type="image" src="https://example.com/button.png">
βsrc
: Defines the image button source.
π Scripts & Styles
<script src="https://example.com/script.js">
βsrc
: Specifies the JavaScript file location.<style>@import url("https://example.com/style.css");</style>
β CSSurl()
function (indirect reference).
𧩠Web Components & App-Specific
<applet codebase="https://example.com/java/">
βcodebase
: Specifies the base URL for a Java applet (deprecated).<meta content="https://example.com" property="og:url">
βcontent
(in Open Graph meta tags).<meta http-equiv="refresh" content="5; url=https://example.com">
β Redirects to a URL.
Last updated
Was this helpful?