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?