:before
or :after
pseudo-elements in the Page or Site Settings under the "Head" section.To use :before
and :after
pseudo-elements in Webflow, you'll need to use custom code, as Webflow’s Designer doesn’t natively support styling these pseudo-elements through its UI.
div
, button
, or heading
) you want to add the :before
or :after
effect to.custom-element
).<style>
tag” section under the “Head” area.Example CSS snippet:
<style>.custom-element::before { content: ""; display: block; width: 100px; height: 2px; background: black; margin-bottom: 10px;}</style>
Key Notes:
::before
or ::after
depending on where you want the effect to appear.**content**
for the pseudo-element to render. Even if it's blank, it needs to be there..custom-element.large::after
, or #myDiv::before
.To use :before
and :after
effects in Webflow, assign a class to your target element and add the necessary custom CSS with pseudo-elements in your site or page settings. These effects only appear on the published site, not in the Designer.