Gibran 0 Posted October 29 Hello, I created a custom CSS class in the design editor. How do I apply my class to an object on the page? Share this post Link to post
tuanphan 6,119 Posted October 29 Target object class/id with Inspect Element, then add CSS to Home > Design > Custom CSS Send me a message if you have any questions | View my service if you need more support View 4200+ Custom Code for Squarespace How to Setup Password & Share Site URL How to find Page ID, Block ID, Section ID Squarespace 7.1 CSS List Share this post Link to post
Gibran 0 Posted October 29 Thanks tuanphan, I'm not sure I understand. I know I can inspect elements and add CSS classes to them, but how do you save it? As soon as I refresh the page, the class disappears from the element. This is what I have as my custom CSS: .xxx { color: green; } How do I add xxx to a <span> element permanently? Share this post Link to post
e2astudio 148 Posted October 30 The only way to add a custom class to an element is to add the element yourself using a Code Block. Share this post Link to post
Gibran 0 Posted October 30 30 minutes ago, e2astudio said: The only way to add a custom class to an element is to add the element yourself using a Code Block. You mean by injecting javascript code? Share this post Link to post
e2astudio 148 Posted October 30 59 minutes ago, Gibran said: You mean by injecting javascript code? No. Generally, there are two ways to customize page elements with CSS. The method @tuanphan is describing (inspect a Squarespace element and find the class already assigned by the system or template, then override or add styles to that specific class in Design -> Custom CSS) Add your own custom class with styles in Design -> Custom CSS and then add a Code Block containing the HTML with your custom class assigned. 1 tuanphan reacted to this Share this post Link to post