pub struct Base;Expand description
The <base> element - document base URL.
§Purpose
The <base> element specifies the base URL to use for all relative URLs in a document.
There can be only one <base> element in a document, and it must be inside the <head> element.
§Content Categories
- Metadata Content
§Permitted Content Model
- None (void element)
§Common Use Cases
- Setting a base URL for all relative links in a document
- Specifying default target for all links
- Useful for single-page applications or sites with complex URL structures
§Key Attributes
href: Base URL for relative URLstarget: Default browsing context for links (e.g.,"_blank","_self")
§Example
<head>
<base href="https://example.com/" target="_blank">
<link rel="stylesheet" href="styles.css">
<!-- Resolves to https://example.com/styles.css -->
</head>§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Base
impl HtmlElement for Base
impl CanContain<Base> for Head
impl MetadataContent for Base
Auto Trait Implementations§
impl Freeze for Base
impl RefUnwindSafe for Base
impl Send for Base
impl Sync for Base
impl Unpin for Base
impl UnwindSafe for Base
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more