Join the Webstudio community

Updated 3 weeks ago

How to add custom CSS code? I would like to add some hover over interaction in the navbar.

It seems there's no way to paste custom CSS code in Webstudio yet, but I may be wrong. I know there's a way to add advanced styling in the righthand side panel, but it seems I'm limited by the styles included in the list. In this case, I have have added custom classes to some elements, so obviously there's no correlation with the options listed there.

For context, these is the CSS code I would like to paste (I've already set up the classes):

.submenu-image-wto,
.submenu-image-usmca,
.submenu-image-dispute {
display: none;
}

.wto-link:hover ~ .submenu-image-wto {
display: block;
}

.usmca-link:hover ~ .submenu-image-usmca {
display: block;
}

.dispute-link:hover ~ .submenu-image-dispute {
display: block;
}
O
s
v
5 comments
Seems like AI was able to answer?
Thanks, Oleg. I'm testing what the AI responded. I will let you know if I cannot get it done.
But in summary, it seems there's no way to inject custom CSS code directly on an element/component basis, right?
if I understand your goal correctly, just insert your code inside a <style></style> tag in an HTML embed at the beginning of your page.
Thank you Vinicius. I just tried doing that, but I am not getting the result I want. Anyways, I will discard the interaction I was seeking. I won't make my life complicated. Thanks again.
Add a reply
Sign up and join the conversation on Discord