:host
:host is a CSS property in the Pseudo-classes category. Selects elements based on state, position, or interaction. The syntax is :host { /* styles */ }. A typical example: :host { display: block; background: white; } It is commonly applied to markup such as <div class="demo">Sample</div> Browser support: Chrome 4+, Firefox 3.5+, Safari 3.1+, Edge 12+. A close relative is :hover, which applies styles when the user hovers over an element with a pointing device. A close relative is :focus, which applies styles when an element has received focus. A close relative is :active, which applies styles while an element is being activated (clicked). More about this category: CSS pseudo-classes for targeting elements based on state or position. Related Pseudo-classes entries: :hover, :focus, :active, :visited, :link, :focus-within, :focus-visible, :target. This page is part of the free CSS Reference documentation covering 841+ properties, selectors, functions, and at-rules, each with syntax, values, examples, and browser support.