Khechog Posted October 25, 2023 Share Posted October 25, 2023 Hi everyone, hope you're well. Could anyone please help me understand the best way to emulate the elements in the attached screen grabs in Squarespace 7.1? This is the site the grabs are taken from. It's not ours, but it's what we want to emulate: https://meditateinireland.com The three elements of text / button / offset line, all need to retain their relationship to each other as browser windows resize or mobile is used (as in screen grabs) I have an idea how this could work which I'll detail below, but need help with the necessary code, OR advice on another way to approach the problem! Possible solution: Create a text block with the 'block background' option turned on. This'll give a bit of internal padding to the block to keep the border offset from the text. Then use code to put a coloured border on just the left hand side of the block. Then use more code to place a button inside the text block. Putting the button inside the block would mean the border on the left of the block always extends down to the bottom of the button even when the block adapts to browser window resizes, as per screen grabs. Am I on the right track? And if so, can anyone please point me to code which allows me to both alter the border of a text box in this way and to place a button inside? Btw, I don't think this will work with text box 'quote' formatting because the line Squarespace puts on the left of a quote needs to extend to the lower edge of the button too. Also, there seems to be another issue with the line on the left of a quote needing code tweaks to appear outside of edit mode. Thank you! Link to comment
tuanphan Posted October 27, 2023 Share Posted October 27, 2023 Possible solution: Create a text block with the 'block background' option turned on. This'll give a bit of internal padding to the block to keep the border offset from the text. Then use code to put a coloured border on just the left hand side of the block. Then use more code to place a button inside the text block. Putting the button inside the block would mean the border on the left of the block always extends down to the bottom of the button even when the block adapts to browser window resizes, as per screen grabs. Yes. This is right direction. With button, just add a hyperlink in Text Block, we can use CSS code to turn it to button You can add text block first, then share link to page where you added it, we can give code Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Khechog Posted October 27, 2023 Author Share Posted October 27, 2023 8 hours ago, tuanphan said: Possible solution: Create a text block with the 'block background' option turned on. This'll give a bit of internal padding to the block to keep the border offset from the text. Then use code to put a coloured border on just the left hand side of the block. Then use more code to place a button inside the text block. Putting the button inside the block would mean the border on the left of the block always extends down to the bottom of the button even when the block adapts to browser window resizes, as per screen grabs. Yes. This is right direction. With button, just add a hyperlink in Text Block, we can use CSS code to turn it to button You can add text block first, then share link to page where you added it, we can give code Fantastic, thank you 🙂 This is our 'under construction' page with the text block at the top: https://www.meditateinthewestmidlands.co.uk/home-2 By the way, I replied to your email before seeing this message, so please disregard the email, thank you. Link to comment
Solution tuanphan Posted October 29, 2023 Solution Share Posted October 29, 2023 Add to Website Tools (under Not Linked) > Custom CSS div#block-yui_3_17_2_1_1698166647126_15157 { border-left: 2px solid #dccb9e; } div#block-yui_3_17_2_1_1698166647126_15157 a { background-color: #798985; color: #dccbce; text-decoration: none !important; padding: 10px 20px; border-radius: 20px; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Khechog Posted October 30, 2023 Author Share Posted October 30, 2023 On 10/29/2023 at 1:09 AM, tuanphan said: Add to Website Tools (under Not Linked) > Custom CSS div#block-yui_3_17_2_1_1698166647126_15157 { border-left: 2px solid #dccb9e; } div#block-yui_3_17_2_1_1698166647126_15157 a { background-color: #798985; color: #dccbce; text-decoration: none !important; padding: 10px 20px; border-radius: 20px; } This is wonderful, thank you! There is one thing that needs modifying if you can help further though please - I removed the 'block background' from the text block as the padding at the top and the bottom of the block made the left border too long. The text block does still need padding, but just on the left hand side, in order to make the line set back from the text a bit - is there code we can add to create this? Many thanks 🙂 Link to comment
Khechog Posted October 30, 2023 Author Share Posted October 30, 2023 52 minutes ago, Khechog said: This is wonderful, thank you! There is one thing that needs modifying if you can help further though please - I removed the 'block background' from the text block as the padding at the top and the bottom of the block made the left border too long. The text block does still need padding, but just on the left hand side, in order to make the line set back from the text a bit - is there code we can add to create this? Many thanks 🙂 Hi - no need to reply to this one - I found the answer in a reply you gave to someone else on this site. I added: padding-left: 30px !important; to the first section of code you gave me. Thank you once again 😄 Maybe there's a link where I could donate to your library project? tuanphan 1 Link to comment
tuanphan Posted November 3, 2023 Share Posted November 3, 2023 You're welcome. If you have any other questions to this problem, just comment here If you are in Vietnam, you can donate books Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) 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