Documentation
¶
Index ¶
- Variables
- func A(elements ...any) hlive.Adder
- func Abbr(elements ...any) hlive.Adder
- func AbbrAttr(value string) *hlive.Attribute
- func Accept(value string) *hlive.Attribute
- func AcceptCharset(value string) *hlive.Attribute
- func Accesskey(value string) *hlive.Attribute
- func Address(elements ...any) hlive.Adder
- func Allow(value string) *hlive.Attribute
- func Allowfullscreen(value string) *hlive.Attribute
- func Alt(value string) *hlive.Attribute
- func Anchor(value string) *hlive.Attribute
- func Area(elements ...any) hlive.Adder
- func Article(elements ...any) hlive.Adder
- func As(value string) *hlive.Attribute
- func Aside(elements ...any) hlive.Adder
- func Async(value string) *hlive.Attribute
- func Attributionsrc(value string) *hlive.Attribute
- func Audio(elements ...any) hlive.Adder
- func Autocapitalize(value string) *hlive.Attribute
- func Autocomplete(value string) *hlive.Attribute
- func Autocorrect(value string) *hlive.Attribute
- func Autofocus(value string) *hlive.Attribute
- func Autoplay(value string) *hlive.Attribute
- func B(elements ...any) hlive.Adder
- func Base(elements ...any) hlive.Adder
- func Bdi(elements ...any) hlive.Adder
- func Bdo(elements ...any) hlive.Adder
- func Blocking(value string) *hlive.Attribute
- func Blockquote(elements ...any) hlive.Adder
- func Body(elements ...any) hlive.Adder
- func Br(elements ...any) hlive.Adder
- func Browsingtopics(value string) *hlive.Attribute
- func Button(elements ...any) hlive.Adder
- func Canvas(elements ...any) hlive.Adder
- func Caption(elements ...any) hlive.Adder
- func Capture(value string) *hlive.Attribute
- func Charset(value string) *hlive.Attribute
- func Checked(value string) *hlive.Attribute
- func Cite(elements ...any) hlive.Adder
- func CiteAttr(value string) *hlive.Attribute
- func Class(value string) *hlive.Attribute
- func Code(elements ...any) hlive.Adder
- func Col(elements ...any) hlive.Adder
- func Colgroup(elements ...any) hlive.Adder
- func Cols(value string) *hlive.Attribute
- func Colspan(value string) *hlive.Attribute
- func Content(value string) *hlive.Attribute
- func Contenteditable(value string) *hlive.Attribute
- func Controls(value string) *hlive.Attribute
- func Controlslist(value string) *hlive.Attribute
- func Coords(value string) *hlive.Attribute
- func Credentialless(value string) *hlive.Attribute
- func Crossorigin(value string) *hlive.Attribute
- func Csp(value string) *hlive.Attribute
- func Data(elements ...any) hlive.Adder
- func DataAttr(value string) *hlive.Attribute
- func Datalist(elements ...any) hlive.Adder
- func Datetime(value string) *hlive.Attribute
- func Dd(elements ...any) hlive.Adder
- func Decoding(value string) *hlive.Attribute
- func Default(value string) *hlive.Attribute
- func Defer(value string) *hlive.Attribute
- func Del(elements ...any) hlive.Adder
- func Details(elements ...any) hlive.Adder
- func Dfn(elements ...any) hlive.Adder
- func Dialog(elements ...any) hlive.Adder
- func Dir(value string) *hlive.Attribute
- func Dirname(value string) *hlive.Attribute
- func Disabled(value string) *hlive.Attribute
- func Disablepictureinpicture(value string) *hlive.Attribute
- func Disableremoteplayback(value string) *hlive.Attribute
- func Div(elements ...any) hlive.Adder
- func Dl(elements ...any) hlive.Adder
- func Download(value string) *hlive.Attribute
- func Draggable(value string) *hlive.Attribute
- func Dt(elements ...any) hlive.Adder
- func Elementtiming(value string) *hlive.Attribute
- func Em(elements ...any) hlive.Adder
- func Embed(elements ...any) hlive.Adder
- func Enterkeyhint(value string) *hlive.Attribute
- func Exportparts(value string) *hlive.Attribute
- func Fencedframe(elements ...any) hlive.Adder
- func Fetchpriority(value string) *hlive.Attribute
- func Fieldset(elements ...any) hlive.Adder
- func Figcaption(elements ...any) hlive.Adder
- func Figure(elements ...any) hlive.Adder
- func Footer(elements ...any) hlive.Adder
- func For(value string) *hlive.Attribute
- func Form(elements ...any) hlive.Adder
- func FormAttr(value string) *hlive.Attribute
- func Formaction(value string) *hlive.Attribute
- func Formenctype(value string) *hlive.Attribute
- func Formmethod(value string) *hlive.Attribute
- func Formnovalidate(value string) *hlive.Attribute
- func Formtarget(value string) *hlive.Attribute
- func H1(elements ...any) hlive.Adder
- func H2(elements ...any) hlive.Adder
- func H3(elements ...any) hlive.Adder
- func H4(elements ...any) hlive.Adder
- func H5(elements ...any) hlive.Adder
- func H6(elements ...any) hlive.Adder
- func Head(elements ...any) hlive.Adder
- func Header(elements ...any) hlive.Adder
- func Headers(value string) *hlive.Attribute
- func Height(value string) *hlive.Attribute
- func Hgroup(elements ...any) hlive.Adder
- func Hidden(value string) *hlive.Attribute
- func High(value string) *hlive.Attribute
- func Hr(elements ...any) hlive.Adder
- func Href(value string) *hlive.Attribute
- func Hreflang(value string) *hlive.Attribute
- func Html(elements ...any) hlive.Adder
- func HttpEquiv(value string) *hlive.Attribute
- func I(elements ...any) hlive.Adder
- func Id(value string) *hlive.Attribute
- func Iframe(elements ...any) hlive.Adder
- func Imagesizes(value string) *hlive.Attribute
- func Imagesrcset(value string) *hlive.Attribute
- func Img(elements ...any) hlive.Adder
- func Inert(value string) *hlive.Attribute
- func Input(elements ...any) hlive.Adder
- func Inputmode(value string) *hlive.Attribute
- func Ins(elements ...any) hlive.Adder
- func Integrity(value string) *hlive.Attribute
- func Is(value string) *hlive.Attribute
- func Ismap(value string) *hlive.Attribute
- func Itemid(value string) *hlive.Attribute
- func Itemprop(value string) *hlive.Attribute
- func Itemref(value string) *hlive.Attribute
- func Itemscope(value string) *hlive.Attribute
- func Itemtype(value string) *hlive.Attribute
- func Kbd(elements ...any) hlive.Adder
- func Kind(value string) *hlive.Attribute
- func Label(elements ...any) hlive.Adder
- func LabelAttr(value string) *hlive.Attribute
- func Lang(value string) *hlive.Attribute
- func Legend(elements ...any) hlive.Adder
- func Li(elements ...any) hlive.Adder
- func Link(elements ...any) hlive.Adder
- func List(value string) *hlive.Attribute
- func Loading(value string) *hlive.Attribute
- func Loop(value string) *hlive.Attribute
- func Low(value string) *hlive.Attribute
- func Main(elements ...any) hlive.Adder
- func Map(elements ...any) hlive.Adder
- func Mark(elements ...any) hlive.Adder
- func Max(value string) *hlive.Attribute
- func Maxlength(value string) *hlive.Attribute
- func Media(value string) *hlive.Attribute
- func Menu(elements ...any) hlive.Adder
- func Meta(elements ...any) hlive.Adder
- func Meter(elements ...any) hlive.Adder
- func Min(value string) *hlive.Attribute
- func Minlength(value string) *hlive.Attribute
- func Multiple(value string) *hlive.Attribute
- func Muted(value string) *hlive.Attribute
- func Name(value string) *hlive.Attribute
- func Nav(elements ...any) hlive.Adder
- func Nomodule(value string) *hlive.Attribute
- func Nonce(value string) *hlive.Attribute
- func Noscript(elements ...any) hlive.Adder
- func Object(elements ...any) hlive.Adder
- func Ol(elements ...any) hlive.Adder
- func Onafterprint(value string) *hlive.Attribute
- func Onbeforeprint(value string) *hlive.Attribute
- func Onbeforeunload(value string) *hlive.Attribute
- func Onblur(value string) *hlive.Attribute
- func Onerror(value string) *hlive.Attribute
- func Onfocus(value string) *hlive.Attribute
- func Onhashchange(value string) *hlive.Attribute
- func Onlanguagechange(value string) *hlive.Attribute
- func Onload(value string) *hlive.Attribute
- func Onmessage(value string) *hlive.Attribute
- func Onoffline(value string) *hlive.Attribute
- func Ononline(value string) *hlive.Attribute
- func Onpopstate(value string) *hlive.Attribute
- func Onresize(value string) *hlive.Attribute
- func Onstorage(value string) *hlive.Attribute
- func Onunload(value string) *hlive.Attribute
- func Open(value string) *hlive.Attribute
- func Optgroup(elements ...any) hlive.Adder
- func Optimum(value string) *hlive.Attribute
- func Option(elements ...any) hlive.Adder
- func Output(elements ...any) hlive.Adder
- func P(elements ...any) hlive.Adder
- func Part(value string) *hlive.Attribute
- func Pattern(value string) *hlive.Attribute
- func Picture(elements ...any) hlive.Adder
- func Ping(value string) *hlive.Attribute
- func Placeholder(value string) *hlive.Attribute
- func Playsinline(value string) *hlive.Attribute
- func Popover(value string) *hlive.Attribute
- func Popovertarget(value string) *hlive.Attribute
- func Popovertargetaction(value string) *hlive.Attribute
- func Portal(elements ...any) hlive.Adder
- func Poster(value string) *hlive.Attribute
- func Pre(elements ...any) hlive.Adder
- func Preload(value string) *hlive.Attribute
- func Progress(elements ...any) hlive.Adder
- func Q(elements ...any) hlive.Adder
- func Readonly(value string) *hlive.Attribute
- func Referrerpolicy(value string) *hlive.Attribute
- func Rel(value string) *hlive.Attribute
- func Required(value string) *hlive.Attribute
- func Reversed(value string) *hlive.Attribute
- func Rows(value string) *hlive.Attribute
- func Rowspan(value string) *hlive.Attribute
- func Rp(elements ...any) hlive.Adder
- func Rt(elements ...any) hlive.Adder
- func Ruby(elements ...any) hlive.Adder
- func S(elements ...any) hlive.Adder
- func Samp(elements ...any) hlive.Adder
- func Sandbox(value string) *hlive.Attribute
- func Scope(value string) *hlive.Attribute
- func Script(elements ...any) hlive.Adder
- func Search(elements ...any) hlive.Adder
- func Section(elements ...any) hlive.Adder
- func Select(elements ...any) hlive.Adder
- func Selected(value string) *hlive.Attribute
- func Shadowrootclonable(value string) *hlive.Attribute
- func Shadowrootdelegatesfocus(value string) *hlive.Attribute
- func Shadowrootmode(value string) *hlive.Attribute
- func Shadowrootserializable(value string) *hlive.Attribute
- func Shape(value string) *hlive.Attribute
- func Size(value string) *hlive.Attribute
- func Sizes(value string) *hlive.Attribute
- func Slot(elements ...any) hlive.Adder
- func SlotAttr(value string) *hlive.Attribute
- func Small(elements ...any) hlive.Adder
- func Source(elements ...any) hlive.Adder
- func Span(elements ...any) hlive.Adder
- func SpanAttr(value string) *hlive.Attribute
- func Spellcheck(value string) *hlive.Attribute
- func Src(value string) *hlive.Attribute
- func Srcdoc(value string) *hlive.Attribute
- func Srclang(value string) *hlive.Attribute
- func Srcset(value string) *hlive.Attribute
- func Start(value string) *hlive.Attribute
- func Step(value string) *hlive.Attribute
- func Strong(elements ...any) hlive.Adder
- func Style(elements ...any) hlive.Adder
- func StyleAttr(value string) *hlive.Attribute
- func Sub(elements ...any) hlive.Adder
- func Summary(elements ...any) hlive.Adder
- func Sup(elements ...any) hlive.Adder
- func Tabindex(value string) *hlive.Attribute
- func Table(elements ...any) hlive.Adder
- func Target(value string) *hlive.Attribute
- func Tbody(elements ...any) hlive.Adder
- func Td(elements ...any) hlive.Adder
- func Template(elements ...any) hlive.Adder
- func Textarea(elements ...any) hlive.Adder
- func Tfoot(elements ...any) hlive.Adder
- func Th(elements ...any) hlive.Adder
- func Thead(elements ...any) hlive.Adder
- func Time(elements ...any) hlive.Adder
- func Title(elements ...any) hlive.Adder
- func TitleAttr(value string) *hlive.Attribute
- func Tr(elements ...any) hlive.Adder
- func Track(elements ...any) hlive.Adder
- func Translate(value string) *hlive.Attribute
- func Type(value string) *hlive.Attribute
- func U(elements ...any) hlive.Adder
- func Ul(elements ...any) hlive.Adder
- func Usemap(value string) *hlive.Attribute
- func Value(value string) *hlive.Attribute
- func Var(elements ...any) hlive.Adder
- func Video(elements ...any) hlive.Adder
- func Virtualkeyboardpolicy(value string) *hlive.Attribute
- func Wbr(elements ...any) hlive.Adder
- func Width(value string) *hlive.Attribute
- func Wrap(value string) *hlive.Attribute
- func Writingsuggestions(value string) *hlive.Attribute
- func Xmlns(value string) *hlive.Attribute
- type DataAttributeInfo
- type DataTag
- type TagData
Constants ¶
This section is empty.
Variables ¶
var AttrFunctionNames = map[string]string{}/* 160 elements not displayed */
AttrFunctionNames maps attribute names to their corresponding function names
var DataAll = TagData{}/* 133 elements not displayed */
var TagFunctions = map[string]func(...any) hlive.Adder{}/* 114 elements not displayed */
TagFunctions maps tag names to their corresponding tag functions
Functions ¶
func A ¶
A - Creates a hyperlink to another web page, file, location, or URL.
The anchor element creates hyperlinks that allow users to navigate between pages or to specific sections within a page. The href attribute specifies the destination URL, while target controls how the link opens (same window, new tab, etc.). The download attribute allows files to be downloaded instead of navigated to. Common mistakes include using empty href attributes (use "#" for placeholder links), not providing descriptive link text for accessibility, using target="_blank" without rel="noopener" (security risk), and creating links that look like buttons but don't function as buttons. Always ensure links have meaningful text and consider the user experience when choosing how links open.
func Abbr ¶
Abbr - Marks an abbreviation or acronym with an optional full form.
The abbreviation element is used to mark abbreviations and acronyms, providing a way to specify the full form via the title attribute. This improves accessibility for screen readers and provides context for users who may not understand the abbreviation. Common mistakes include using abbr without a title attribute (defeating the purpose), using it for decorative purposes instead of actual abbreviations, and not providing meaningful full forms. Always include the complete expanded form in the title attribute and ensure the abbreviation is actually abbreviated text, not just styled text.
func AcceptCharset ¶
AcceptCharset represents a accept-charset attribute
func Address ¶
Address - Contains contact information for the nearest article or body element ancestor.
The address element provides contact information for the document or the nearest article or body element ancestor. It should contain contact information like email addresses, physical addresses, phone numbers, or links to contact pages. Common mistakes include using address for any postal address (it's specifically for contact info related to the document), using it for general contact information not related to the document, and nesting it inside other address elements. The address element should be used for contact information that is relevant to the current document or section, not for general contact details.
func Allowfullscreen ¶
Allowfullscreen represents a allowfullscreen attribute
func Area ¶
Area - Defines a clickable area within an image map.
The area element defines a clickable region within an image map, allowing different parts of an image to link to different destinations. It must be used within a map element and requires shape and coords attributes to define the clickable area. Common mistakes include using area without a proper map element, not providing meaningful alt text for accessibility, using complex shapes that are difficult to click, and creating image maps when CSS-based solutions would be more appropriate. Image maps should be used sparingly as they can be difficult to maintain and may not work well on mobile devices.
func Article ¶
Article - Represents a self-contained composition that could be independently distributable.
The article element represents a self-contained piece of content that could be distributed independently, such as a blog post, news article, or forum post. It should contain content that makes sense on its own and could be syndicated. Common mistakes include using article for any content section (use section instead), nesting articles unnecessarily, and using it for content that isn't self-contained. The article element should be used for content that could be extracted and still make sense, such as individual blog posts, news stories, or forum comments.
func Aside ¶
Aside - Represents content that is tangentially related to the main content.
The aside element contains content that is tangentially related to the main content, such as sidebars, pull quotes, or advertising. It should not contain content that is essential to understanding the main content. Common mistakes include using aside for any sidebar content (it should be tangentially related), placing essential navigation in aside, and using it for content that is directly related to the main content. The aside element is perfect for content like related links, author information, or supplementary material that enhances but isn't required for understanding the main content.
func Attributionsrc ¶
Attributionsrc represents a attributionsrc attribute
func Audio ¶
Audio - Embeds sound content with playback controls.
The audio element embeds sound content into documents with built-in playback controls. It supports multiple audio formats and can include fallback content for browsers that don't support the audio element. Common mistakes include using autoplay without user consent (many browsers block this), not providing fallback content for unsupported browsers, using unsupported audio formats, and not providing proper accessibility features. Always include controls for user control, provide alternative text or transcripts for accessibility, and ensure the audio file is in a widely supported format like MP3 or OGG.
func Autocapitalize ¶
Autocapitalize represents a autocapitalize attribute
func Autocomplete ¶
Autocomplete represents a autocomplete attribute
func Autocorrect ¶
Autocorrect represents a autocorrect attribute
func B ¶
B - Makes text bold without conveying importance.
The b element makes text bold but does not convey any semantic meaning of importance. It should be used for styling purposes only, such as keywords in a summary or product names in a review. Common mistakes include using b for important text (use strong instead), using it for headings (use h1-h6), and using it when semantic meaning is intended. The b element is purely presentational and should not be used when you want to convey importance, emphasis, or semantic meaning. For important text, use strong; for emphasis, use em; for highlighting, use mark.
func Bdi ¶
Bdi - Isolates bidirectional text from its surrounding content.
The bdi element isolates a span of text that might be formatted in a different direction from its surrounding text. It's useful for user-generated content or text from external sources where the text direction is unknown. Common mistakes include using bdi when the text direction is known (use dir attribute instead), overusing bdi unnecessarily, and not understanding when bidirectional text isolation is needed. The bdi element is particularly useful for internationalized content, user comments, or any content where the text direction might differ from the surrounding text. Always consider whether the text direction is truly unknown before using bdi.
func Blockquote ¶
Blockquote - Blockquote tag - represents a blockquote element
func Body ¶
Body - Contains the visible content of the HTML document.
The body element contains all the visible content of the HTML document, including text, images, forms, and other elements. It represents the main content area that users see and interact with. Common mistakes include placing structural elements outside of body, not providing proper semantic structure within body, and using deprecated styling attributes. The body element should contain all visible content and should be properly structured with semantic elements like header, main, section, and footer. Always ensure the body contains meaningful content and follows proper HTML structure.
func Br ¶
Br - Creates a line break in text content.
The br element creates a line break in text content, moving the following content to a new line. It should be used sparingly and only for line breaks within text content, not for layout purposes. Common mistakes include using br for layout spacing (use CSS margin/padding instead), using multiple br elements for spacing, and using br when semantic elements would be better. The br element is appropriate for line breaks in addresses, poetry, or other content where line breaks are part of the content structure. Always consider whether CSS or semantic elements would be more appropriate before using br.
func Browsingtopics ¶
Browsingtopics represents a browsingtopics attribute
func Button ¶
Button - Creates a clickable button for user interaction.
The button element creates a clickable button that can trigger actions, submit forms, or perform JavaScript functions. It supports different types including submit, reset, and button. Common mistakes include using div or span with click handlers instead of button (accessibility issue), not specifying the type attribute (defaults to submit in forms), using button for navigation (use anchor instead), and not providing proper accessibility attributes. Always specify the type attribute, use meaningful text content, and ensure the button is keyboard accessible. For form submission, prefer button type="submit" over input type="submit" for better styling control.
func Canvas ¶
Canvas - Provides a drawing surface for JavaScript graphics and animations.
The canvas element provides a drawing surface that can be used with JavaScript to create graphics, animations, and interactive visual content. It requires JavaScript to be functional and should include fallback content for users with JavaScript disabled. Common mistakes include not providing fallback content, using canvas for simple images (use img instead), not setting appropriate dimensions, and not handling canvas context properly. The canvas element is perfect for games, data visualizations, and custom graphics. Always provide fallback content and ensure the canvas is accessible to users with disabilities.
func Caption ¶
Caption - Provides a caption or title for a table.
The caption element provides a caption or title for a table, describing the table's content or purpose. It should be the first child of the table element and provide clear context for the table data. Common mistakes include using caption for any text near a table (it should be a caption), not providing meaningful captions, and using it outside of a table element. The caption element is perfect for providing context about what the table contains, such as "Monthly Sales Report" or "User Demographics". Always ensure the caption provides clear context for the table content.
func Cite ¶
Cite - Marks the title of a creative work or reference.
The cite element marks the title of a creative work such as a book, movie, song, or website. It should be used for the title of the work being referenced, not for the author or other metadata. Common mistakes include using cite for author names (use appropriate text), using it for any reference (it's specifically for titles), and not understanding the difference between cite and blockquote. The cite element is perfect for referencing titles of books, articles, movies, songs, and other creative works. Always use it for the actual title of the work being referenced.
func Code ¶
Code - Marks computer code within text content.
The code element marks computer code within text content, such as variable names, function names, or short code snippets. It should be used for inline code references, not for code blocks (use pre with code for that). Common mistakes include using code for code blocks (use pre with code), using it for any technical term (use appropriate text), and not providing proper context for the code. The code element is perfect for referencing variables, functions, file names, and short code snippets within text. Always ensure the code is properly contextualized and accessible.
func Col ¶
Col - Defines column properties in a table.
The col element defines column properties for table columns, allowing you to apply styles or attributes to entire columns. It must be used within a colgroup element and affects all cells in the specified columns. Common mistakes include using col outside of colgroup, using it for styling when CSS would be better, and not understanding that col is for column properties, not content. The col element is useful for applying consistent styling to table columns or for accessibility purposes. Always use col within colgroup and consider whether CSS would be more appropriate for styling.
func Colgroup ¶
Colgroup - Groups table columns for applying properties.
The colgroup element groups table columns together, allowing you to apply properties to multiple columns at once. It contains col elements and must be placed before the table body. Common mistakes include using colgroup without col elements, placing it after table content, and using it for styling when CSS would be better. The colgroup element is useful for applying consistent properties to groups of columns or for accessibility purposes. Always place colgroup before tbody and ensure it contains appropriate col elements.
func Contenteditable ¶
Contenteditable represents a contenteditable attribute
func Controlslist ¶
Controlslist represents a controlslist attribute
func Credentialless ¶
Credentialless represents a credentialless attribute
func Crossorigin ¶
Crossorigin represents a crossorigin attribute
func Data ¶
Data - Links content to a machine-readable equivalent.
The data element links content to a machine-readable equivalent via the value attribute, allowing both human-readable and machine-readable versions of the same data. It's useful for dates, times, measurements, and other data that has both human and machine representations. Common mistakes include using data for any content (it should have a machine-readable equivalent), not providing a meaningful value attribute, and using it when other semantic elements would be better. The data element is perfect for prices, dates, measurements, and other structured data that benefits from machine-readable equivalents.
func Datalist ¶
Datalist - Provides a list of predefined options for input elements.
The datalist element provides a list of predefined options that can be used with input elements to create autocomplete functionality. It contains option elements and is referenced by input elements via the list attribute. Common mistakes include using datalist without connecting it to an input, using it for navigation (use nav instead), and not providing meaningful option values. The datalist element is perfect for providing suggestions for text inputs, such as search suggestions, form autocomplete, or predefined options. Always ensure the datalist is properly connected to an input element and provides useful suggestions.
func Dd ¶
Dd - Provides the description in a description list.
The dd element provides the description, definition, or value in a description list (dl). It should be used in conjunction with dt (description term) elements to create definition lists. Common mistakes include using dd outside of a dl element, using it for any content (it should be a description), and not properly pairing it with dt elements. The dd element is perfect for definitions, descriptions, and any content that provides details about a term or concept. Always use dd within a dl element and ensure it's properly paired with dt elements.
func Del ¶
Del - Marks text that has been deleted from the document.
The del element marks text that has been deleted or removed from the document, typically displayed with a strikethrough effect. It can be used with the cite attribute to reference the reason for deletion and datetime to specify when the deletion occurred. Common mistakes include using del for any crossed-out text (it should represent actual deletions), not providing context for the deletion, and using it for styling purposes. The del element is perfect for showing document revisions, tracking changes, or indicating removed content. Always provide context for deletions when possible.
func Details ¶
Details - Creates a disclosure widget that can show/hide additional content.
The details element creates a disclosure widget that can be toggled to show or hide additional content. It contains a summary element that serves as the clickable label and additional content that can be revealed or hidden. Common mistakes include not including a summary element, using details for any collapsible content (consider accessibility), and not providing proper fallback for older browsers. The details element is perfect for FAQs, additional information sections, and any content that can be optionally revealed. Always include a summary element and ensure the content is accessible when collapsed.
func Dfn ¶
Dfn - Marks the defining instance of a term.
The dfn element marks the defining instance of a term, typically the first occurrence where the term is defined or explained. It helps establish the meaning of a term for subsequent references. Common mistakes include using dfn for any term (it should be the defining instance), using it multiple times for the same term, and not providing proper context for the definition. The dfn element is perfect for glossaries, technical documentation, and any content where terms are defined. Always ensure the term is actually being defined and provide clear context for the definition.
func Dialog ¶
Dialog - Creates a modal or non-modal dialog box.
The dialog element creates a dialog box that can be either modal (blocking interaction with the rest of the page) or non-modal. It provides a native way to create popup dialogs without JavaScript frameworks. Common mistakes include not providing proper focus management, not handling the dialog state properly, and not ensuring accessibility features. The dialog element is perfect for confirmations, forms, and any content that should appear in a popup. Always ensure proper focus management, provide escape key handling, and make the dialog accessible to screen readers.
func Disablepictureinpicture ¶
Disablepictureinpicture represents a disablepictureinpicture attribute
func Disableremoteplayback ¶
Disableremoteplayback represents a disableremoteplayback attribute
func Div ¶
Div - Generic block-level container for grouping content.
The div element is a generic block-level container used for grouping and styling content. It has no semantic meaning and should be used when no other semantic element is appropriate. Common mistakes include using div when semantic elements would be better (use section, article, nav, etc.), overusing div for layout (prefer CSS Grid and Flexbox), and creating deeply nested div structures. Always consider if a semantic element like section, article, nav, or main would be more appropriate before using div. Use div primarily for styling and layout purposes when no semantic meaning is needed.
func Dl ¶
Dl - Creates a description list with terms and definitions.
The dl element creates a description list that contains terms (dt) and their descriptions (dd). It's used for glossaries, metadata, and any content that pairs terms with their definitions or values. Common mistakes include using dl for any list (use ul or ol for simple lists), not properly pairing dt and dd elements, and using it for navigation (use nav instead). The dl element is perfect for glossaries, metadata displays, and any content that has term-definition relationships. Always ensure proper pairing of dt and dd elements and use it for actual descriptions, not just any content.
func Dt ¶
Dt - Defines a term in a description list.
The dt element defines a term in a description list (dl). It should be used in conjunction with dd (description details) elements to create definition lists. Common mistakes include using dt outside of a dl element, using it for any content (it should be a term), and not properly pairing it with dd elements. The dt element is perfect for terms, names, labels, and any content that needs to be defined or described. Always use dt within a dl element and ensure it's properly paired with dd elements.
func Elementtiming ¶
Elementtiming represents a elementtiming attribute
func Em ¶
Em - Marks text with emphasis or stress.
The em element marks text with emphasis or stress, typically displayed in italics. It conveys semantic meaning of emphasis, not just visual styling. Common mistakes include using em for any italic text (use CSS for styling), using it for important text (use strong instead), and not understanding the semantic difference between em and i. The em element is perfect for emphasizing words or phrases within text, such as highlighting key points or adding vocal stress. Always use em when you want to convey emphasis, not just for visual styling.
func Embed ¶
Embed - Embeds external content or interactive applications.
The embed element embeds external content or interactive applications into the document, such as browser plugins, PDFs, or other multimedia content. It's a generic embedding element that can handle various types of content. Common mistakes include using embed for images (use img), not providing proper fallback content, and not specifying the type attribute. The embed element is useful for embedding PDFs, Flash content (though deprecated), and other external applications. Always provide fallback content and consider whether iframe or object would be more appropriate.
func Enterkeyhint ¶
Enterkeyhint represents a enterkeyhint attribute
func Exportparts ¶
Exportparts represents a exportparts attribute
func Fencedframe ¶
Fencedframe - Creates a privacy-preserving iframe for cross-origin content.
The fencedframe element creates a privacy-preserving iframe that provides better isolation for cross-origin content. It's designed to prevent cross-site tracking while still allowing embedded content. Common mistakes include using fencedframe for all iframe use cases (use iframe for same-origin content), not understanding its experimental status, and not providing proper fallback content. The fencedframe element is perfect for embedding third-party content that needs privacy protection, such as ads or social media widgets. Always provide fallback content and consider browser support before using this experimental element. Experimental: This element is experimental and may not be supported in all browsers.
func Fetchpriority ¶
Fetchpriority represents a fetchpriority attribute
func Fieldset ¶
Fieldset - Groups related form controls together.
The fieldset element groups related form controls together, creating a logical section within a form. It should contain a legend element to provide a caption for the group. Common mistakes include using fieldset without a legend, using it for any content grouping (it should be for form controls), and not providing meaningful grouping. The fieldset element is perfect for grouping related form fields like personal information, shipping details, or payment information. Always include a legend element and ensure the grouping makes logical sense for the form structure.
func Figcaption ¶
Figcaption - Provides a caption or legend for a figure element.
The figcaption element provides a caption, legend, or description for a figure element. It can be placed before or after the figure content and should provide meaningful context for the figure. Common mistakes include using figcaption outside of a figure element, not providing meaningful captions, and using it for any text near an image. The figcaption element is perfect for providing descriptions of images, diagrams, charts, or any content within a figure element. Always ensure the caption is descriptive and provides context for the figure content.
func Figure ¶
Figure - Contains self-contained content like images, diagrams, or code blocks.
The figure element contains self-contained content such as images, diagrams, illustrations, code blocks, or other content that is referenced from the main content. It can include a figcaption element for providing a caption or description. Common mistakes include using figure for any content (it should be self-contained), not providing proper captions, and using it for decorative images. The figure element is perfect for images with captions, diagrams, charts, code examples, and any content that is referenced from the main text. Always ensure the content is self-contained and consider adding a figcaption for context.
func Footer ¶
Footer - Contains footer content for a section or document.
The footer element contains footer content for the nearest sectioning content or body element. It typically includes copyright information, contact details, links to related documents, or other footer content. Common mistakes include using footer for any content at the bottom of a page (it should be footer content), placing navigation in footer when it should be in nav, and not understanding that footer is semantic, not just positional. The footer element is perfect for copyright notices, contact information, site links, and any content that belongs at the end of a section or document. Always ensure the content is actually footer material, not just content positioned at the bottom.
func Form ¶
Form - Creates an interactive form for collecting user input.
The form element creates an interactive form that collects and submits user input to a server. It can contain various form controls like inputs, textareas, and buttons. Common mistakes include not providing proper labels for form controls, using GET method for sensitive data, not validating input on both client and server side, and not providing proper error handling. Always include proper labels, use appropriate input types, implement server-side validation, and ensure forms are accessible. The method attribute should be POST for data that changes server state, and GET for data retrieval.
func Formaction ¶
Formaction represents a formaction attribute
func Formenctype ¶
Formenctype represents a formenctype attribute
func Formmethod ¶
Formmethod represents a formmethod attribute
func Formnovalidate ¶
Formnovalidate represents a formnovalidate attribute
func Formtarget ¶
Formtarget represents a formtarget attribute
func H1 ¶
H1 - Defines the most important heading in the document.
The h1 element defines the most important heading in the document and should typically be used only once per page. It represents the main topic or title of the page content. Common mistakes include using multiple h1 elements on the same page, using h1 for styling purposes, and not following proper heading hierarchy. The h1 element should be the main title of the page and should be followed by h2, h3, etc. in a logical hierarchy. Always ensure there's only one h1 per page and that it accurately represents the main content of the document.
func H2 ¶
H2 - Defines a secondary heading in the document.
The h2 element defines a secondary heading that should be used for major sections within the page content. It should follow the h1 element in the heading hierarchy. Common mistakes include skipping heading levels (going from h1 to h3), using h2 for styling purposes, and not maintaining proper heading structure. The h2 element is perfect for major sections, chapters, or main topics within the page. Always maintain proper heading hierarchy and ensure h2 elements are used for actual section headings, not just styled text.
func H3 ¶
H3 - Defines a tertiary heading in the document.
The h3 element defines a tertiary heading that should be used for subsections within h2 sections. It should follow the proper heading hierarchy after h2 elements. Common mistakes include using h3 without proper h2 parent sections, using it for styling purposes, and not maintaining logical heading structure. The h3 element is perfect for subsections, sub-topics, or detailed breakdowns of h2 content. Always ensure h3 elements are properly nested within h2 sections and maintain logical content hierarchy.
func H4 ¶
H4 - Defines a fourth-level heading in the document.
The h4 element defines a fourth-level heading that should be used for detailed subsections within h3 sections. It should follow the proper heading hierarchy and be used sparingly. Common mistakes include using h4 without proper parent headings, using it for styling purposes, and creating overly deep heading hierarchies. The h4 element is perfect for detailed breakdowns of h3 content or very specific topics. Always ensure proper heading hierarchy and consider whether the content structure is becoming too complex.
func H5 ¶
H5 - Defines a fifth-level heading in the document.
The h5 element defines a fifth-level heading that should be used very sparingly for very detailed subsections. It should follow the proper heading hierarchy and typically indicates very specific content breakdowns. Common mistakes include using h5 without proper parent headings, creating overly complex heading structures, and using it for styling purposes. The h5 element should be used rarely and only for very detailed content organization. Always consider whether the heading hierarchy is becoming too complex and whether the content could be better organized.
func H6 ¶
H6 - Defines the lowest-level heading in the document.
The h6 element defines the lowest-level heading and should be used extremely sparingly. It represents the most detailed level of content organization and should only be used when absolutely necessary. Common mistakes include using h6 without proper parent headings, creating overly complex heading structures, and using it for styling purposes. The h6 element should rarely be used and typically indicates very specific, detailed content breakdowns. Always consider whether the content structure is becoming too complex and whether alternative organization methods would be better.
func Head ¶
Head - Contains metadata about the HTML document.
The head element contains metadata about the HTML document, including title, meta tags, links to stylesheets, and other document-level information. It should be placed before the body element and contains elements that provide information about the document rather than visible content. Common mistakes include placing visible content in head, not including essential meta tags, and not providing proper document metadata. The head element is perfect for document titles, character encoding, viewport settings, and links to external resources. Always include essential metadata like charset, viewport, and title elements.
func Header ¶
Header - Contains introductory content for a section or document.
The header element contains introductory content for the nearest sectioning content or body element. It typically includes headings, navigation, logos, or other introductory content. Common mistakes include using header for any content at the top of a page (it should be introductory content), placing main content in header, and not understanding that header is semantic, not just positional. The header element is perfect for page titles, navigation, logos, and any introductory content that belongs at the beginning of a section or document. Always ensure the content is actually introductory material, not just content positioned at the top.
func Hgroup ¶
Hgroup - Groups related headings together.
The hgroup element groups related headings together, typically a main heading with one or more subheadings. It's used when you have a heading with a subtitle or tagline that should be treated as a unit. Common mistakes include using hgroup for any group of headings (it should be related headings), using it when headings should be separate, and not understanding its specific purpose. The hgroup element is perfect for main titles with subtitles, article titles with bylines, or any case where related headings should be grouped together. Always ensure the headings are actually related and should be treated as a unit.
func Hr ¶
Hr - Creates a thematic break between content sections.
The hr element creates a thematic break between content sections, typically displayed as a horizontal line. It represents a change in topic or theme within the document. Common mistakes include using hr for visual styling only (use CSS for decorative lines), using it too frequently, and not understanding its semantic purpose. The hr element is perfect for separating different topics, sections, or themes within a document. Always ensure the break represents an actual thematic change, not just visual separation.
func Html ¶
Html - The root element of an HTML document.
The html element is the root element of an HTML document and contains all other elements. It should include the lang attribute to specify the document's language and may include the xmlns attribute for XHTML compatibility. Common mistakes include not specifying the lang attribute, placing content outside of html, and not understanding its role as the document root. The html element is essential for all HTML documents and should contain the head and body elements. Always include the lang attribute for accessibility and internationalization.
func I ¶
I - Marks text in an alternate voice or mood.
The i element marks text that is in an alternate voice or mood, such as foreign words, technical terms, or thoughts. It conveys semantic meaning of alternate voice, not just visual styling. Common mistakes include using i for any italic text (use CSS for styling), using it for emphasis (use em instead), and not understanding the semantic difference between i and em. The i element is perfect for foreign words, technical terms, taxonomic designations, and any text that represents an alternate voice or mood. Always use i when you want to convey alternate voice, not just for visual styling.
func Iframe ¶
Iframe - Embeds another HTML page within the current document.
The iframe element embeds another HTML page or document within the current page. It creates a browsing context that can display external content, videos, or other web pages. Common mistakes include using iframe for all embedded content (consider alternatives like embed or object), not providing proper fallback content, and not considering security implications. The iframe element is perfect for embedding maps, videos, social media widgets, and other external content. Always consider security implications, provide fallback content, and use appropriate sandbox attributes for untrusted content.
func Imagesizes ¶
Imagesizes represents a imagesizes attribute
func Imagesrcset ¶
Imagesrcset represents a imagesrcset attribute
func Img ¶
Img - Embeds an image into the document.
The img element embeds an image into the HTML document. It requires a src attribute to specify the image source and should always include an alt attribute for accessibility. Common mistakes include not providing meaningful alt text (use alt="" for decorative images), using images for text content, not optimizing images for web, and using deprecated attributes like align and border. Always provide appropriate alt text, optimize images for performance, use responsive images with srcset for different screen sizes, and consider using the loading="lazy" attribute for images below the fold.
func Input ¶
Input - Creates various types of form input controls.
The input element creates form controls for collecting user data. It supports many types including text, email, password, number, date, file, and more. Common mistakes include not using appropriate input types (use email for email addresses, number for numbers), not providing labels for accessibility, using placeholder as a substitute for labels, not validating input properly, and using deprecated attributes. Always use semantic input types, provide proper labels, implement proper validation, and ensure accessibility. The type attribute is crucial for proper functionality and user experience.
func Ins ¶
Ins - Marks text that has been inserted into the document.
The ins element marks text that has been inserted or added to the document, typically displayed with an underline. It can be used with the cite attribute to reference the reason for insertion and datetime to specify when the insertion occurred. Common mistakes include using ins for any underlined text (it should represent actual insertions), not providing context for the insertion, and using it for styling purposes. The ins element is perfect for showing document revisions, tracking changes, or indicating added content. Always provide context for insertions when possible.
func Kbd ¶
Kbd - Marks keyboard input or user input.
The kbd element marks keyboard input or user input that should be entered by the user. It's typically displayed in a monospace font and is used for indicating keyboard shortcuts, commands, or user input. Common mistakes include using kbd for any monospace text (use code instead), using it for program output (use samp instead), and not understanding its specific purpose. The kbd element is perfect for keyboard shortcuts, command line instructions, and any text that represents user input. Always ensure the content is actually user input that should be entered, not just styled text.
func Label ¶
Label - Provides a label for a form control.
The label element provides a label for a form control, improving accessibility and user experience. It can be associated with a form control using the for attribute or by nesting the control within the label. Common mistakes include not providing labels for form controls, using labels for non-form content, and not properly associating labels with their controls. The label element is essential for accessibility and should be used for all form controls. Always provide descriptive labels and ensure proper association with form controls.
func Legend ¶
Legend - Provides a caption for a fieldset element.
The legend element provides a caption or title for a fieldset element, describing the group of form controls within the fieldset. It should be the first child of the fieldset and provide clear context for the grouped form elements. Common mistakes include using legend outside of a fieldset, not providing meaningful captions, and using it for any text near form elements. The legend element is perfect for grouping related form controls and providing context for the group, such as personal information, shipping details, or payment information. Always ensure the legend provides clear context for the fieldset content.
func Li ¶
Li - Defines a list item within an ordered or unordered list.
The li element defines a list item within an ordered (ol) or unordered (ul) list. It can contain any content that makes sense as a list item. Common mistakes include using li outside of ol or ul elements, using it for any content (it should be a list item), and not providing meaningful list content. The li element is perfect for creating lists of items, steps, options, or any content that should be presented as a list. Always ensure the content is appropriate for a list and use proper list structure.
func Link ¶
Link - Links the document to external resources like stylesheets.
The link element links the document to external resources such as stylesheets, icons, or other documents. It's typically placed in the head section and provides metadata about relationships with other resources. Common mistakes include using link for navigation (use a instead), not providing proper rel attributes, and not understanding its purpose for external resources. The link element is perfect for linking stylesheets, favicons, preload resources, and other external dependencies. Always provide appropriate rel and href attributes and ensure the resource is actually needed.
func Main ¶
Main - Contains the main content of the document.
The main element contains the primary content of the document, excluding navigation, headers, footers, and sidebars. There should typically be only one main element per page. Common mistakes include having multiple main elements on the same page, including navigation or footer content in main, and using main for content that isn't the primary focus. The main element should contain the most important content that users are looking for, such as articles, blog posts, or the core functionality of a web application. Always ensure main content is accessible and properly structured.
func Map ¶
Map - Defines an image map with clickable areas.
The map element defines an image map that contains clickable areas (area elements) within an image. It's used with the img element to create interactive images where different parts link to different destinations. Common mistakes include using map without area elements, using it for any image (it should be for interactive images), and not providing proper accessibility features. The map element is perfect for creating interactive diagrams, navigation images, or any image that needs clickable regions. Always provide meaningful alt text for areas and consider whether CSS-based solutions would be more appropriate.
func Mark ¶
Mark - Highlights text for reference or relevance.
The mark element highlights text for reference purposes or to indicate relevance in the current context. It's typically displayed with a yellow background and is used to draw attention to specific parts of text. Common mistakes include using mark for any highlighted text (it should be for reference), using it for important text (use strong instead), and not understanding its specific purpose. The mark element is perfect for highlighting search results, indicating relevance in search contexts, or drawing attention to specific parts of quoted text. Always ensure the highlighting is for reference purposes, not just for visual emphasis.
func Menu ¶
Menu - Represents a list of commands or tools.
The menu element represents a list of commands or tools that can be activated by the user. It's used for creating contextual menus, toolbars, or lists of actions. Common mistakes include using menu for any list (use ul or ol for simple lists), using it for navigation (use nav instead), and not understanding its specific purpose for commands. The menu element is perfect for contextual menus, toolbars, and any interface that provides a list of actions or commands. Always ensure the content represents actual commands or tools, not just any list of items.
func Meta ¶
Meta - Provides metadata about the HTML document.
The meta element provides metadata about the HTML document, including character encoding, viewport settings, SEO information, and other document properties. It's placed in the head section and provides information that browsers, search engines, and other applications can use. Common mistakes include not including essential meta tags like charset and viewport, using meta for visible content, and not providing meaningful metadata. The meta element is essential for proper document setup and should include charset, viewport, and other relevant metadata. Always include essential meta tags and provide meaningful content for SEO and accessibility.
func Meter ¶
Meter - Represents a scalar measurement within a known range.
The meter element represents a scalar measurement within a known range, such as disk usage, progress, or ratings. It provides a visual representation of a value within a defined range. Common mistakes include using meter for progress bars (use progress instead), not providing proper min/max values, and using it for any measurement (it should be for scalar values). The meter element is perfect for disk usage, ratings, scores, and any measurement that has a defined range. Always provide meaningful min, max, and value attributes and ensure the measurement is actually scalar.
func Nav ¶
Nav - Defines a section of navigation links.
The nav element defines a section of navigation links, such as main navigation, table of contents, or pagination. It should contain links that help users navigate the site or document. Common mistakes include using nav for any list of links (it should be for navigation), not providing proper accessibility features, and including non-navigation content. The nav element is perfect for main site navigation, breadcrumbs, pagination, and other navigation-related content. Always ensure navigation is keyboard accessible and consider using ARIA labels for complex navigation structures.
func Noscript ¶
Noscript - Provides fallback content when JavaScript is disabled.
The noscript element provides fallback content that is displayed when JavaScript is disabled or not supported by the browser. It should contain alternative content that provides the same functionality or information as the JavaScript-dependent content. Common mistakes include not providing meaningful fallback content, using noscript for any content (it should be fallback), and not testing with JavaScript disabled. The noscript element is perfect for providing alternative navigation, content, or functionality when JavaScript is unavailable. Always ensure the fallback content is meaningful and provides equivalent functionality to the JavaScript version.
func Object ¶
Object - Embeds multimedia content like PDFs, Flash, or other objects.
The object element embeds multimedia content such as PDFs, Flash applications, or other external objects into the document. It provides a generic way to embed various types of content and can include fallback content. Common mistakes include using object for images (use img instead), not providing fallback content, and not specifying the type attribute. The object element is perfect for embedding PDFs, Flash content (though deprecated), and other multimedia objects. Always provide fallback content and consider whether iframe or embed would be more appropriate.
func Ol ¶
Ol - Creates an ordered list of items.
The ol element creates an ordered list of items, typically displayed with numbers or letters. It contains li elements and can be customized with different numbering styles. Common mistakes include using ol for any list (use ul for unordered lists), not providing meaningful list items, and using it for navigation (use nav instead). The ol element is perfect for step-by-step instructions, rankings, or any content that has a specific order. Always ensure the list items are actually ordered and provide meaningful content for each item.
func Onafterprint ¶
Onafterprint represents a onafterprint attribute
func Onbeforeprint ¶
Onbeforeprint represents a onbeforeprint attribute
func Onbeforeunload ¶
Onbeforeunload represents a onbeforeunload attribute
func Onhashchange ¶
Onhashchange represents a onhashchange attribute
func Onlanguagechange ¶
Onlanguagechange represents a onlanguagechange attribute
func Onpopstate ¶
Onpopstate represents a onpopstate attribute
func Optgroup ¶
Optgroup - Groups related options within a select element.
The optgroup element groups related options within a select element, creating a hierarchical structure for the dropdown list. It should contain option elements and provide a label to describe the group. Common mistakes include using optgroup without options, not providing meaningful labels, and using it for any grouping (it should be for related options). The optgroup element is perfect for organizing large dropdown lists into logical groups, such as countries by region or products by category. Always provide meaningful labels and ensure the grouping makes logical sense.
func Option ¶
Option - Defines an option within a select or datalist element.
The option element defines an option within a select or datalist element. It represents a choice that users can select from a dropdown list or autocomplete suggestions. Common mistakes include using option outside of select or datalist, not providing meaningful text content, and not setting appropriate values. The option element is perfect for creating dropdown choices, autocomplete suggestions, and any list of selectable options. Always provide meaningful text content and appropriate value attributes for form processing.
func Output ¶
Output - Represents the result of a calculation or user action.
The output element represents the result of a calculation or user action, such as the result of a form calculation or the output of a script. It's typically used within forms to display computed values or results. Common mistakes include using output for any text (it should be for calculated results), not providing proper labels, and not understanding its specific purpose for results. The output element is perfect for displaying calculated totals, form results, or any computed values. Always provide proper labels and ensure the content is actually a result of some calculation or action.
func P ¶
P - Defines a paragraph of text content.
The p element defines a paragraph of text content. It's used for grouping related text content into logical paragraphs. Common mistakes include using p for any content (it should be text content), nesting block elements inside p, and using p for layout purposes. The p element is perfect for paragraphs of text, descriptions, and any content that should be treated as a paragraph. Always ensure the content is actual text content and not using p for layout or styling purposes.
func Picture ¶
Picture - Provides multiple image sources for responsive images.
The picture element provides multiple image sources for responsive images, allowing different images to be displayed based on device capabilities, screen size, or other conditions. It contains source elements and a fallback img element. Common mistakes include not providing a fallback img element, using picture for any image (use img for simple images), and not providing meaningful source elements. The picture element is perfect for responsive images, art direction, and providing different image formats for different browsers. Always include a fallback img element and ensure the source elements provide meaningful alternatives.
func Placeholder ¶
Placeholder represents a placeholder attribute
func Playsinline ¶
Playsinline represents a playsinline attribute
func Popovertarget ¶
Popovertarget represents a popovertarget attribute
func Popovertargetaction ¶
Popovertargetaction represents a popovertargetaction attribute
func Portal ¶
Portal - Creates a portal for seamless page transitions.
The portal element creates a portal that allows seamless transitions between pages without full page reloads. It's an experimental feature that provides a way to embed and navigate between pages more smoothly. Common mistakes include using portal for all navigation (use regular links for most cases), not understanding its experimental status, and not providing proper fallback content. The portal element is perfect for creating smooth page transitions in single-page applications or progressive web apps. Always provide fallback content and consider browser support before using this experimental element. Experimental: This element is experimental and may not be supported in all browsers.
func Pre ¶
Pre - Defines preformatted text that preserves whitespace and formatting.
The pre element defines preformatted text that preserves whitespace, line breaks, and formatting. It's typically displayed in a monospace font and is used for code blocks, ASCII art, or any text that needs to maintain its original formatting. Common mistakes include using pre for any monospace text (use code for inline code), using it for styling purposes, and not understanding its purpose for preserving formatting. The pre element is perfect for code blocks, ASCII art, poetry, and any content that requires exact formatting preservation. Always ensure the content actually needs formatting preservation.
func Progress ¶
Progress - Represents the completion progress of a task.
The progress element represents the completion progress of a task, such as file uploads, downloads, or any process that has a defined completion state. It provides a visual indicator of progress within a known range. Common mistakes include using progress for measurements (use meter instead), not providing proper max and value attributes, and using it for any bar (it should be for progress). The progress element is perfect for file uploads, downloads, installation progress, and any task that has a defined completion state. Always provide meaningful max and value attributes and ensure the content represents actual progress.
func Q ¶
Q - Marks a short inline quotation.
The q element marks a short inline quotation that doesn't require paragraph breaks. It's typically displayed with quotation marks and can include a cite attribute to reference the source. Common mistakes include using q for any quoted text (use blockquote for longer quotes), not providing proper citation, and using it for emphasis (use em instead). The q element is perfect for short quotes, citations, or any brief quoted content that fits within a paragraph. Always provide proper citation when possible and ensure the content is actually quoted material.
func Referrerpolicy ¶
Referrerpolicy represents a referrerpolicy attribute
func Rp ¶
Rp - Provides fallback parentheses for ruby annotations.
The rp element provides fallback parentheses for ruby annotations when the browser doesn't support ruby text. It's used within ruby elements to provide alternative display for ruby text. Common mistakes include using rp outside of ruby elements, using it for any parentheses, and not understanding its specific purpose for ruby fallback. The rp element is perfect for providing fallback display for ruby annotations in browsers that don't support them. Always use rp within ruby elements and ensure it provides meaningful fallback content.
func Rt ¶
Rt - Provides ruby text annotations for base text.
The rt element provides ruby text annotations for base text within a ruby element. It's used for phonetic guides, translations, or other annotations that appear above or beside the base text. Common mistakes include using rt outside of ruby elements, using it for any small text, and not understanding its specific purpose for annotations. The rt element is perfect for phonetic guides, translations, and any annotations that should appear with the base text. Always use rt within ruby elements and ensure the annotation is meaningful and relevant.
func Ruby ¶
Ruby - Contains ruby annotations for base text.
The ruby element contains ruby annotations that provide phonetic guides, translations, or other annotations for base text. It typically contains base text with rt (ruby text) elements for annotations and rp elements for fallback parentheses. Common mistakes include using ruby for any text with annotations (it should be for phonetic guides or translations), not providing proper fallback content, and not understanding its specific purpose. The ruby element is perfect for phonetic guides in languages like Japanese, Chinese translations, and any case where annotations should appear with base text. Always ensure the annotations are meaningful and relevant to the base text.
func S ¶
S - Marks text that is no longer accurate or relevant.
The s element marks text that is no longer accurate or relevant, typically displayed with a strikethrough effect. It indicates that the text is no longer correct or applicable. Common mistakes include using s for any crossed-out text (it should indicate inaccuracy), using it for deleted content (use del instead), and not understanding its specific purpose. The s element is perfect for marking outdated information, incorrect prices, or any text that is no longer accurate or relevant. Always ensure the text is actually inaccurate or no longer relevant before using s.
func Samp ¶
Samp - Marks sample output from a computer program.
The samp element marks sample output from a computer program or system. It's typically displayed in a monospace font and represents actual output that would be generated by a program. Common mistakes include using samp for any monospace text (use code instead), using it for user input (use kbd instead), and not understanding its specific purpose for program output. The samp element is perfect for displaying command line output, program results, or any text that represents actual output from a computer system. Always ensure the content is actually program output, not just styled text.
func Script ¶
Script - Embeds or references JavaScript code in the document.
The script element embeds or references JavaScript code in the document. It can contain inline JavaScript or reference external scripts via the src attribute. Common mistakes include placing script in the head without defer/async, not providing fallback content, and not considering performance implications. The script element is essential for adding interactivity to web pages. Always consider placement (head vs body), use appropriate loading attributes (defer/async), and ensure scripts don't block page rendering.
func Search ¶
Search - Contains a search form or search functionality.
The search element contains a search form or search functionality for the document or application. It represents a search interface that allows users to find content within the site or application. Common mistakes include using search for any form (it should be specifically for search), not providing proper search functionality, and using it for navigation (use nav instead). The search element is perfect for site search forms, application search interfaces, and any content that provides search functionality. Always ensure the content is actually search-related and provides meaningful search capabilities.
func Section ¶
Section - Defines a thematic grouping of content.
The section element represents a thematic grouping of content, typically with a heading. It should contain content that forms a distinct part of the document. Common mistakes include using section for any content grouping (use div for styling-only grouping), not providing headings within sections, and using section when article would be more appropriate. The section element is ideal for chapters, tabbed content, or any content that forms a distinct theme. Always include a heading element within section to provide context for the content grouping.
func Select ¶
Select - Creates a dropdown list of options for user selection.
The select element creates a dropdown list that allows users to choose from predefined options. It contains option elements and can be configured for single or multiple selection. Common mistakes include not providing proper labels, using select for navigation (use nav instead), not handling the change event properly, and creating overly complex nested options. Always provide meaningful labels, use option groups for related options, ensure keyboard accessibility, and consider using datalist for autocomplete functionality. The multiple attribute allows multiple selections, while size controls the number of visible options.
func Shadowrootclonable ¶
Shadowrootclonable represents a shadowrootclonable attribute
func Shadowrootdelegatesfocus ¶
Shadowrootdelegatesfocus represents a shadowrootdelegatesfocus attribute
func Shadowrootmode ¶
Shadowrootmode represents a shadowrootmode attribute
func Shadowrootserializable ¶
Shadowrootserializable represents a shadowrootserializable attribute
func Slot ¶
Slot - Defines a placeholder in a web component template.
The slot element defines a placeholder within a web component template where content can be inserted. It's used with custom elements to create flexible content insertion points. Common mistakes include using slot outside of web components, not providing meaningful slot names, and not understanding its purpose for content distribution. The slot element is perfect for creating reusable web components that can accept different content. Always provide meaningful slot names and ensure the slot is used within a proper web component context.
func Small ¶
Small - Marks fine print or side comments.
The small element marks fine print, side comments, or less important text. It's used for disclaimers, copyright notices, or any text that should be de-emphasized. Common mistakes include using small for any small text (use CSS for sizing), using it for important disclaimers (they should still be accessible), and not understanding its semantic purpose. The small element is perfect for copyright notices, legal disclaimers, side comments, and any text that should be visually de-emphasized but still accessible. Always ensure the content is actually less important, not just visually smaller.
func Source ¶
Source - Specifies media sources for audio, video, or picture elements.
The source element specifies media sources for audio, video, or picture elements, allowing multiple formats or sizes to be provided for different browsers or devices. It should be used within media elements to provide fallback options. Common mistakes include using source outside of media elements, not providing meaningful src attributes, and not understanding its purpose for multiple sources. The source element is perfect for providing multiple video formats, responsive images, or audio alternatives. Always provide meaningful src attributes and ensure the source is appropriate for the parent element.
func Span ¶
Span - Generic inline container for grouping text content.
The span element is a generic inline container used for grouping and styling text content. It has no semantic meaning and should be used when no other semantic element is appropriate. Common mistakes include using span when semantic elements would be better (use strong, em, mark, etc.), overusing span for styling (prefer CSS classes), and using span for block-level content (use div instead). Always consider if a semantic element like strong, em, mark, or time would be more appropriate before using span. Use span primarily for applying styles or JavaScript hooks to inline content.
func Spellcheck ¶
Spellcheck represents a spellcheck attribute
func Strong ¶
Strong - Marks text with strong importance or seriousness.
The strong element marks text with strong importance, seriousness, or urgency. It conveys semantic meaning of importance, not just visual styling. Common mistakes include using strong for any bold text (use CSS for styling), using it for emphasis (use em instead), and not understanding the semantic difference between strong and b. The strong element is perfect for important warnings, critical information, and any text that has strong importance or seriousness. Always use strong when you want to convey importance, not just for visual styling.
func Style ¶
Style - Contains CSS styles for the document.
The style element contains CSS styles that apply to the document. It's typically placed in the head section and can include inline styles or reference external stylesheets. Common mistakes include placing style in the body, not providing proper CSS syntax, and using it for external stylesheets (use link instead). The style element is perfect for page-specific styles, critical CSS, or any styles that should be embedded in the document. Always ensure proper CSS syntax and consider whether external stylesheets would be more appropriate.
func Sub ¶
Sub - Marks subscript text.
The sub element marks subscript text, which appears below the baseline. It's used for mathematical expressions, chemical formulas, or any text that should be displayed as subscript. Common mistakes include using sub for any small text (use CSS for sizing), using it for footnotes (use appropriate text), and not understanding its specific purpose for subscript. The sub element is perfect for mathematical subscripts, chemical formulas, and any text that should appear below the baseline. Always ensure the content is actually subscript text, not just smaller text.
func Summary ¶
Summary - Provides a visible heading for a details element.
The summary element provides a visible heading for a details element, serving as the clickable label that controls the disclosure of the details content. It should be the first child of the details element and provide clear context for the collapsible content. Common mistakes include using summary outside of a details element, not providing meaningful headings, and using it for any text near details. The summary element is perfect for providing clear labels for collapsible content sections. Always ensure the summary provides clear context for the details content.
func Sup ¶
Sup - Marks superscript text.
The sup element marks superscript text, which appears above the baseline. It's used for mathematical expressions, footnotes, or any text that should be displayed as superscript. Common mistakes include using sup for any small text (use CSS for sizing), using it for any elevated text, and not understanding its specific purpose for superscript. The sup element is perfect for mathematical exponents, footnote references, and any text that should appear above the baseline. Always ensure the content is actually superscript text, not just smaller text.
func Table ¶
Table - Creates a table for displaying tabular data.
The table element creates a table for displaying tabular data in rows and columns. It should contain thead, tbody, and tfoot elements for proper structure. Common mistakes include using table for layout (use CSS Grid or Flexbox), not providing proper table structure, and not using semantic table elements. The table element is perfect for displaying data that has a clear row and column structure, such as financial data, schedules, or comparison charts. Always use proper table structure with thead, tbody, and appropriate headers.
func Tbody ¶
Tbody - Groups the main content of a table.
The tbody element groups the main content rows of a table. It should contain tr elements and represents the primary data of the table. Common mistakes include using tbody without proper table structure, placing it before thead, and not understanding its role in table organization. The tbody element is essential for proper table structure and should contain the main data rows of the table. Always ensure proper table structure with thead, tbody, and tfoot elements.
func Td ¶
Td - Defines a data cell in a table.
The td element defines a data cell in a table row. It should contain the actual data content and can span multiple columns or rows using colspan and rowspan attributes. Common mistakes include using td for header cells (use th instead), not providing meaningful content, and using it for layout purposes. The td element is perfect for displaying actual data values in tables, such as numbers, text, or other content. Always ensure the content is actual data and use th for header cells.
func Template ¶
Template - Contains HTML content that can be cloned and used later.
The template element contains HTML content that is not rendered immediately but can be cloned and used later with JavaScript. It's useful for creating reusable content patterns or dynamic content that will be inserted into the document. Common mistakes include using template for visible content (it's not rendered), not understanding its purpose for content reuse, and using it when other elements would be more appropriate. The template element is perfect for creating reusable UI components, dynamic content patterns, or any content that will be cloned and inserted programmatically. Always ensure the content is meant to be cloned and not displayed directly.
func Textarea ¶
Textarea - Creates a multi-line text input field.
The textarea element creates a multi-line text input field for longer text content like comments, descriptions, or messages. It supports resizing and can be configured with various attributes for validation and user experience. Common mistakes include not providing proper labels, using textarea for single-line input (use input instead), not setting appropriate rows and cols, and not handling the content properly on form submission. Always provide meaningful labels, set appropriate dimensions, implement proper validation, and consider accessibility features like spellcheck and autocorrect.
func Tfoot ¶
Tfoot - Groups the footer content of a table.
The tfoot element groups the footer content of a table, such as totals, summaries, or other footer information. It should contain tr elements and appears after tbody in the table structure. Common mistakes include using tfoot without proper table structure, placing it before tbody, and not understanding its role for footer content. The tfoot element is perfect for displaying totals, summaries, or any content that belongs at the bottom of a table. Always ensure proper table structure and use tfoot for actual footer content.
func Th ¶
Th - Defines a header cell in a table.
The th element defines a header cell in a table that provides context for the data cells. It should contain descriptive text that explains what the data in the column or row represents. Common mistakes include using th for data cells (use td instead), not providing meaningful header text, and using it for layout purposes. The th element is perfect for column headers, row headers, or any cell that provides context for table data. Always provide descriptive header text and use scope attributes to indicate the header's relationship to data cells.
func Thead ¶
Thead - Groups the header content of a table.
The thead element groups the header content of a table, containing the column headers that describe the data in each column. It should contain tr elements with th cells and appears before tbody in the table structure. Common mistakes include using thead without proper table structure, placing it after tbody, and not understanding its role for header content. The thead element is essential for proper table structure and should contain the column headers that describe the table data. Always ensure proper table structure and use thead for actual header content.
func Time ¶
Time - Marks a specific time or date.
The time element marks a specific time or date, providing both human-readable and machine-readable versions. It can include a datetime attribute to provide the machine-readable format. Common mistakes include using time for any date reference (it should be for specific times/dates), not providing datetime attributes, and using it for time ranges (use appropriate text). The time element is perfect for publication dates, event times, or any specific time or date reference. Always provide datetime attributes when possible and ensure the content represents a specific time or date.
func Title ¶
Title - Defines the document title shown in browser tabs and bookmarks.
The title element defines the document title that appears in browser tabs, bookmarks, and search engine results. It should be placed in the head section and provide a concise, descriptive title for the page. Common mistakes include using generic titles like "Home" or "Page", making titles too long, and not providing unique titles for each page. The title element is crucial for SEO, accessibility, and user experience. Always provide descriptive, unique titles that accurately represent the page content and are under 60 characters for optimal display.
func Tr ¶
Tr - Defines a row in a table.
The tr element defines a row in a table, containing td (data) or th (header) cells. It should be used within table, thead, tbody, or tfoot elements to create the table structure. Common mistakes include using tr outside of table elements, not providing proper cell content, and using it for layout purposes. The tr element is essential for table structure and should contain appropriate td or th cells. Always ensure proper table structure and use tr only within table-related elements.
func Track ¶
Track - Specifies text tracks for audio or video elements.
The track element specifies text tracks for audio or video elements, such as subtitles, captions, or descriptions. It provides accessibility features for multimedia content. Common mistakes include using track outside of audio/video elements, not providing proper src attributes, and not understanding its purpose for accessibility. The track element is perfect for providing subtitles, captions, descriptions, or any text-based content for multimedia. Always provide meaningful src attributes and ensure the track content is appropriate for the media.
func U ¶
U - Marks text that should be stylistically different from normal text.
The u element marks text that should be stylistically different from normal text, such as proper names in Chinese text or text that should be underlined for non-typographical reasons. It conveys semantic meaning of stylistically different text, not just visual styling. Common mistakes include using u for any underlined text (use CSS for styling), using it for links (use a instead), and not understanding its specific purpose. The u element is perfect for proper names in Chinese text, misspelled words, or any text that should be stylistically different for non-typographical reasons. Always use u when you want to convey semantic difference, not just for visual styling.
func Ul ¶
Ul - Creates an unordered list of items.
The ul element creates an unordered list of items, typically displayed with bullet points. It contains li elements and is used for lists that don't have a specific order or hierarchy. Common mistakes include using ul for any list (use ol for ordered lists), not providing meaningful list items, and using it for navigation (use nav instead). The ul element is perfect for lists of features, options, or any content that doesn't require a specific order. Always ensure the list items are meaningful and appropriate for an unordered list.
func Var ¶
Var - Marks a variable name in mathematical or programming context.
The var element marks a variable name in mathematical expressions, programming code, or other contexts where variables are referenced. It's typically displayed in italics and represents a variable that can have different values. Common mistakes include using var for any italic text (use CSS for styling), using it for emphasis (use em instead), and not understanding its specific purpose for variables. The var element is perfect for mathematical variables, programming variables, and any text that represents a variable name. Always ensure the content is actually a variable name, not just styled text.
func Video ¶
Video - Embeds video content with playback controls.
The video element embeds video content into the document with built-in playback controls. It supports multiple video formats and can include fallback content for browsers that don't support the video element. Common mistakes include using autoplay without user consent (many browsers block this), not providing fallback content, using unsupported video formats, and not providing proper accessibility features. The video element is perfect for embedding video content, tutorials, or any multimedia that requires video playback. Always include controls for user control, provide alternative content for accessibility, and ensure the video file is in a widely supported format.
func Virtualkeyboardpolicy ¶
Virtualkeyboardpolicy represents a virtualkeyboardpolicy attribute
func Wbr ¶
Wbr - Suggests a line break opportunity within a word.
The wbr element suggests a line break opportunity within a word, allowing long words to be broken at appropriate points when necessary. It's used for very long words, URLs, or other text that might need to be broken across lines. Common mistakes include using wbr for any word (it should be for very long words), using it too frequently, and not understanding its specific purpose for line break opportunities. The wbr element is perfect for long URLs, very long words, and any text that might need to be broken across lines for better layout. Always ensure the break point is appropriate and the word remains readable.
func Writingsuggestions ¶
Writingsuggestions represents a writingsuggestions attribute
Types ¶
type DataAttributeInfo ¶
type DataAttributeInfo struct {
Deprecated bool `json:"deprecated,omitempty"`
Experimental bool `json:"experimental,omitempty"`
}
DataAttributeInfo represents the metadata for an attribute.
type DataTag ¶
type DataTag struct {
Deprecated bool `json:"deprecated,omitempty"`
Experimental bool `json:"experimental,omitempty"`
Attributes map[string]DataAttributeInfo `json:"attributes,omitempty"`
DescriptionShort string `json:"description_short,omitempty"`
DescriptionLong string `json:"description_long,omitempty"`
}
DataTag represents the metadata for a tag, including its attributes.