Join the Webstudio community

Updated 4 months ago

CSS <style> ignored when published

At a glance

The community member added an HTML Embed with a CSS rule to remove the underline from links, but the underline reappeared when the content was published. The comments suggest this is likely due to specificity issues, where another more specific rule is overriding the custom CSS. The community members discuss ways to share the live site to help troubleshoot the issue, as well as the possibility of using the UI to turn off the "browser defaults" for links site-wide. However, there is no explicitly marked answer in the provided information.

Useful resources
I added and HTML Embed with "<style> a {text-decoration: none}; </style>". The blue underlines disappear as expected in the editor. When published however they reappear below any link text. These are in a card that is inside a "link" element.
Attachment
underline.png
J
v
4 comments
Probably due to specificity issues... ie something more specific is telling it to add an underline. You can share the site and I'll let you know..

But why not just use the UI to set it?
@John Siciliano Hey John, Is there a way to share the project without also sharing the database tokens? As to UI, I didn't see how to turn off the "browser defaults" site wide. How would I do that? Thanks, Jim
You can just send the live site in this case so I can see what’s overriding it.

There’s no global default for links. You’d set a token for each link. Some people prefer the custom css route in this case though
I set the Link on the card that contains the image & links. I don't see how to turn off the link formatting inside the Link container. Here's the site https://learn-lk3gk.wstd.io/ (Desktop version only at present)
Add a reply
Sign up and join the conversation on Discord