gclarke Posted June 2, 2020 Share Posted June 2, 2020 Site URL: https://life-of-charlie.squarespace.com/blog/game-changing-skincare I've used custom CSS to implement a drop cap on the first letter of the first paragraph of a blog post. To do so, I applied a class to the entire first block of text using a code block, up until the first non-text element (an image, in this case), to prevent inconsistent spacing between paragraphs (code blocks have a bit more padding). However, it appears that links within the text in that code block are not inheriting the same styling as all other links. Is there an issue with how I've created the link? Or a way to force p a {} elements within a code block to inherit Squarespace's default link styling via CSS? Site is currently password-protected, use code buildout. Thanks! Link to comment
jpeter Posted June 2, 2020 Share Posted June 2, 2020 The reason is due to CSS specificity. See screenshot. To override you could use a higher specificity using the following CSS: .blog-item-wrapper .blog-item-content p a { /* add css here to override */ } Link to comment
gclarke Posted June 4, 2020 Author Share Posted June 4, 2020 Thank you for that! For others' reference, I used the following .blog-item-wrapper .blog-item-content p a { color: @accent; background-repeat: repeat-x; background-image: linear-gradient(to right,currentColor 180%,currentColor 0); background-size: 1px 1px; background-position: 0 100%; white-space: initial; } to override all link styling in the blog post paragraphs, regardless of whether or not they were within the code block. In this case, @accent is assigned to the hex code of my palette accent color. Link to comment
Charlie1 Posted March 6, 2021 Share Posted March 6, 2021 Anyone know the new css tags for paragraphs on Squarespace? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment