Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesYou can use a hyphenated tag such as <layout-stack> as a reusable CSS layout wrapper without registering a Web Component. The tag gives a layout pattern a name; CSS sets its display, spacing, and sizing. It does not add new layout capabilities or make the wrapper a semantic element such as <main>, <nav>, or <button>.
What “CSS-only custom element” means
In this pattern, an author writes a hyphenated tag in HTML and styles it with an ordinary CSS selector. The tag is a convenient name for a recurring layout rule, not a JavaScript-defined component.
For example, this markup and CSS express a vertical stack with consistent spacing:
<layout-stack>
<h2>Heading</h2>
<p>Content</p>
</layout-stack>
layout-stack {
display: flex;
flex-direction: column;
gap: 1rem;
}
The browser applies CSS to the tag selector just as it does to other selectors. The display value establishes the wrapper’s layout behavior; here, flexbox arranges the children in a column and gap separates them. CSS Display describes display in terms of outer and inner types: a value such as grid or flex supplies an inner layout mode.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
This is a conceptual example, not a claim of a particular browser test. The wrapper is useful only insofar as its rules clarify or reuse your design.
How this differs from a registered Web Component
A hyphen in a tag name does not itself register a Custom Element. The HTML Standard’s custom-element mechanism lets code define how an element is constructed and how it reacts to changes. A CSS-only layout wrapper does not need customElements.define(), lifecycle callbacks, or Shadow DOM.
Rank #2
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
The distinction matters because a custom name does not confer native meaning. The HTML Standard cautions that “simply defining and using an element called taco-button does not mean that such elements represent buttons.” A button-like interface still needs appropriate semantics and behavior; a custom layout tag is not a substitute for a native control.
If you add registry code, lifecycle behavior, or Shadow DOM, you are building a JavaScript-defined Web Component rather than using only a custom tag as CSS vocabulary. See web.dev’s guide to custom elements for those component capabilities.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
Choosing a custom tag, a class, or a data attribute
Use a named wrapper when the layout is a repeated, recognizable primitive and the tag makes your markup easier to scan. A documented CSS-only implementation, Vanilla Breeze, shows primitives such as stack, grid, sidebar, cluster, center, and switcher; it also documents a data-layout option. These are examples of an authoring approach, not a requirement to adopt that framework or its vocabulary. See Vanilla Breeze.
- Custom tag: Consider it for a recurring layout wrapper whose name communicates its purpose to your team.
- Class or data attribute: Prefer one when the rule is a one-off adjustment or when keeping the element’s native tag prominent is clearer. A data-attribute convention is another way to name layout styles.
- Semantic HTML element: Use the native element that matches the content role, such as
<main>for the page’s main content or<nav>for navigation. Add layout styling without replacing that meaning. - Registered Web Component: Choose this when the use case needs custom construction, reactions to attribute or child changes, or encapsulation—not merely a reusable flex or grid rule.
A custom tag does not make a layout more powerful than CSS applied to a class or native element. The choice is about clarity, reuse, and the semantics of the markup.
Rank #4
Keep semantics separate from visual layout
CSS controls presentation and layout; the document language supplies meaning. The CSS Display specification states that the display property has no effect on an element’s semantics. A tag chosen for a layout role should therefore not displace a meaningful HTML element when the content has a defined role.
For example, a site’s main content can remain inside <main> and use a class or nested layout wrapper for its arrangement. Likewise, navigation should remain marked up as navigation, and interactive controls should use suitable native elements. This keeps visual organization from being mistaken for semantic or interactive behavior.
Best Value
Use display: contents cautiously
display: contents is a special case, not a general recipe for custom wrappers. It suppresses the element’s own generated box while its children and pseudo-elements can still generate boxes. That can be useful in specific layout situations, but it changes how the wrapper participates in box layout.
The CSS Display specification also warns that accessibility tools may fail to expose the wrapper’s semantics correctly in major browsers. Avoid applying it casually to a semantically meaningful element, and check behavior in the browsers and assistive technologies that matter for your project. The support summary alone cannot establish accessibility equivalence.
As of the usage period reported by Can I Use for August 2026, display: contents had 96.46% global usage coverage when supported and partial support are combined; the underlying usage data is attributed to StatCounter GlobalStats. That figure is not a measure of full, uniform support: the current table also marks support as partial for several major engine and version ranges. Consult Can I Use’s display: contents table for the detailed status, which can change over time.
A practical way to design a layout primitive
- Start with the content role. Choose suitable semantic HTML first. Decide whether the layout wrapper can sit inside that structure without obscuring its meaning.
- Name a repeated pattern. Use a custom tag, class, or data attribute only if it makes a recurring rule more discoverable. Keep a one-off rule simple.
- Define the behavior in CSS. Choose the display mode and specify the relevant spacing, sizing, and responsive rules. The wrapper name itself does not create those behaviors.
- Check the special cases. If the design uses
display: contentson a meaningful wrapper, review browser support and accessibility behavior for your targets. - Add JavaScript only when needed. If you need registration, lifecycle reactions, or Shadow DOM, treat the work as a Web Component and design for that model explicitly.
The CSS Display Level 3 publication page identifies its cited Candidate Recommendation Draft as published on June 5, 2026. For the relevant standards details, see the HTML Standard’s discussion of autonomous custom-element drawbacks and the CSS Display Module Level 3.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

