Jump to content

Add Full Height Vertical Line within Section

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://www.leadwithbliss.squarespace.com

Hi!

I'm working on the following website:

www.leadwithbliss.squarespace.com

Password: leadwithbliss

I'm trying to add a full-height, vertical line within a section to achieve this look:

 

1191521609_BlissMockup.thumb.png.678d2965b9d696506967691096c8c625.png

 

So far, I have added the following code: 

Code Block:

<div class="vl"></div>

CSS: 

.vl {
  border-right: 1px solid #000000; 
  height: 800px; 
  position: absolute;
  left: 110%;
}

However, I'm stuck and cannot get the line to go to the top of the section:

 

1298495829_ScreenShot2021-06-03at12_56_57PM.thumb.png.551fe5a9c89768721b17636f299b9537.png

 

Any suggestions? Thanks in advance for your help! 

Link to comment
  • 1 month later...

I'm also experiencing the same problem. I know nothing about css. I got to this point on my page by following code by @tuanphanand developers on Youtube. 

Any help will be appreciated. even with the remove padding codes the line wont move up. 

wont move up.jpg

Link to comment

@chiskoprapunzel

Please post the URL for your site.

If your site is not public please set up a site-wide password, if you've not already done so.

Post the password here.

Adding a site-wide password is not a security breach. Please read the documentation at the link provided to understand how it works.

We can then take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 5 weeks later...

@tuanphan back with a follow-up question. do you have any idea why the vertical line in the 'my approach' section of the 'coaching' page does not appear in the same position as the 'conscious coaching' section on the home page? I suspect it's because the structure of the elements in the block is different than all of the other sections I have added the vertical line to so where I added the code in the block is different. However, I figured I'd ask in case you have any comments. Is the only way to make the position match to add custom code for this section?

The URL and pass have remained the same.

The code I have added for this is:

Code Block:

<div class="vl-right"></div>

CSS: 

.vl-right {
  border-right: 1px solid #000000; 
  height: 800px; 
  position: absolute;
  left: 110%;
}

[data-section-id="60d0e85e724ba127a9a08e7b"] .content-wrapper  {
    padding-top: 0 !important;
}

Thanks in advance!

Link to comment
On 8/24/2021 at 7:11 AM, stellaehabib said:

@tuanphan back with a follow-up question. do you have any idea why the vertical line in the 'my approach' section of the 'coaching' page does not appear in the same position as the 'conscious coaching' section on the home page? I suspect it's because the structure of the elements in the block is different than all of the other sections I have added the vertical line to so where I added the code in the block is different. However, I figured I'd ask in case you have any comments. Is the only way to make the position match to add custom code for this section?

The URL and pass have remained the same.

The code I have added for this is:

Code Block:

<div class="vl-right"></div>

CSS: 

.vl-right {
  border-right: 1px solid #000000; 
  height: 800px; 
  position: absolute;
  left: 110%;
}

[data-section-id="60d0e85e724ba127a9a08e7b"] .content-wrapper  {
    padding-top: 0 !important;
}

Thanks in advance!

Can you share link to page where you have problem?

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
On 8/27/2021 at 4:34 AM, stellaehabib said:

@tuanphan yes, this occurs on the home (www.leadwithbliss.com) and coaching (www.leadwithbliss.com/coaching) pages (pass: leadwithbliss). You'll notice that the left/right vertical lines vary in position depending upon the section that they are in.  Thanks 🙂

 

Hi,

Try adding a Line Block here (line width = text width)

next, add a Code Block under >> add vl code 

Next, remove Line Block & check again

image.thumb.png.4b1d7ac723f5d59fd8c4b106e5cde092.png

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
  • 4 weeks later...
  • 10 months later...
On 8/8/2022 at 9:39 PM, JazLewis28 said:

Hi there! @tuanphan @stellaehabib

I am wanting to put a vertical line in the centre of one of my sections too. Like this: (this is just a mockup) and I stumbled across this code however the line isn't fixed on the section and moves when change the size of the screen. Can anyone help? and on mobile it doesn't work? 

image.thumb.png.ee35a16ffa7109f1f64b57106d708b17.png

Screenshot 2022-08-08 at 15.38.56.png

Can you share link to your site? I think we can use code to add a left or right border

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

@tuanphan 

Thank you! The line attaches to the bottom section when the screen is at a normal size but when i expand to fit a bigger screen the line no longer attaches. 

This is the code i used:

.vl-centre {
  background: #000000; 
  width: 1px; 
  height: 760px;
  margin: 0 auto;
}

@media screen and (max-width: 640px) {
    .vl-centre {
        display:none
    }
}

Of course, it's 

bamboo-fiddle-xxx4.squarespace.com
Password: JL19934439!

Thanks,
Jaz

Edited by JazLewis28
Link to comment
On 8/17/2022 at 12:46 AM, JazLewis28 said:

@tuanphan 

Thank you! The line attaches to the bottom section when the screen is at a normal size but when i expand to fit a bigger screen the line no longer attaches. 

This is the code i used:

.vl-centre {
  background: #000000; 
  width: 1px; 
  height: 760px;
  margin: 0 auto;
}

@media screen and (max-width: 640px) {
    .vl-centre {
        display:none
    }
}

Of course, it's 

bamboo-fiddle-xxx4.squarespace.com
Password: JL19934439!

Thanks,
Jaz

You mean it has this space?

image.png.211d0a1bdbc76f8c6fd90e2d7cec787e.png

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
On 8/18/2022 at 8:52 PM, JazLewis28 said:

@tuanphan 

Yeah it makes this space when you make the web browser bigger. It doesn't seem to render with different screen sizes 

The site is expired. You can access this link to extend trial

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
On 8/22/2022 at 4:09 PM, JazLewis28 said:

@tuanphanThanks for the link! I have extended my website now  🙂

It looks like you will need to increase height value in some screen sizes (screen sizes where you have problem)

You can add some code like this

@media screen and (min-width:1350px) and (max-width:1700px) {
.vl-centre {
    height: 1000px;
}
}

this code will run from 1350 to 1700px screen

(Just an example, you can adjust these values)

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
  • 1 year later...

Hi! I'm playing with a website for a client and I have a similar issue as the ones above. This is the url: https://geboortecentrum-baarn.squarespace.com/verloop-zwangerschap (everything is in Dutch) and the password: landkroon.

I am wondering if I can make the vertical line the top section responsive with the height of the section? I know it's too long now because of the code, of course I can make it smaller, but I want it to move with the section, I want it to be responsive whatever the size of the screen is. It doesn't need to be shown on mobile (already in the code). 

This is the code I used in the codeblock: 

<div class="vertical-line"></div>

and this I put in the Custom CSS: /

//vertical line///
@media screen and (min-width: 768px) {
  .vertical-line {
  background: #474747;
  width: 1px;
  height: 3670px;
  margin: 0 auto;
}
}

Hope you can help! Thanks so much 🙂

Link to comment
On 4/15/2024 at 4:42 PM, robienhali said:

Hi! I'm playing with a website for a client and I have a similar issue as the ones above. This is the url: https://geboortecentrum-baarn.squarespace.com/verloop-zwangerschap (everything is in Dutch) and the password: landkroon.

I am wondering if I can make the vertical line the top section responsive with the height of the section? I know it's too long now because of the code, of course I can make it smaller, but I want it to move with the section, I want it to be responsive whatever the size of the screen is. It doesn't need to be shown on mobile (already in the code). 

This is the code I used in the codeblock: 

<div class="vertical-line"></div>

and this I put in the Custom CSS: /

//vertical line///
@media screen and (min-width: 768px) {
  .vertical-line {
  background: #474747;
  width: 1px;
  height: 3670px;
  margin: 0 auto;
}
}

Hope you can help! Thanks so much 🙂

I checked some screen sizes and I see it is fine. Or you mean remove white space between lines?

image.thumb.png.636ea91b1bf77c51e8f9ffbf2a4ed084.png

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.