Jump to content

How to align text to the very top of the block

Go to solution Solved by creedon,

Recommended Posts

Posted (edited)

Hello! I'm trying to figure out how to get this large H1 to be flush against the top of the text box and section. I have tried multiple css options that seem to be focusing on getting the block itself to the top of the section, and not the actual text in the block. I'm sure this is something to do with the line height, but I am not sure what the solution would be. Any help is appreciated! 

https://abigailjames.squarespace.com 

It currently looks like this: image.thumb.png.a407172e0dad43998da2d3cb4827dfc1.png

But it needs to looks like this: 

image.thumb.png.6775f3949ec0aa12e6fb7f8fea6fce4f.png

 

Edited by amandaabbott
  • Solution
Posted

This isn't a solution but one possible starting point.

/* nudge text blocks up */

#block-06adc4d7bf862e37a580,
#block-e813dfb08df4fee63ce1,
#block-992e00ad0c50659a08bc

  {
  
    margin-top : -0.5em;
    
    }

Let us know how it goes.

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.

Posted

Ah that actually did work pretty well! I was wanting it for the "work with me" text, so I just changed the block-id and it seemed to do the trick. It does seem to move depending on the screen size though, so I think I'll need to add some workaround there.

Thank you so much 🙂

  • 1 month later...
Posted

Hello there, I am trying to find a solution here too. I want my h1 to sit at the very top of the block so I can align it with an image block nearby. Did you find another solution other than controlling via block ID please?

Posted
On 9/25/2024 at 11:24 PM, prado2020 said:

Hello there, I am trying to find a solution here too. I want my h1 to sit at the very top of the block so I can align it with an image block nearby. Did you find another solution other than controlling via block ID please?

Can you share link to page where you use h1 + image block? We can check easier

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!)

Posted
6 hours ago, tuanphan said:

Can you share link to page where you use h1 + image block? We can check easier

 Sure, here is the page in question https://www.fitzmaurice.works/ I was trying to align the h1 'Latest News' with the top edge of the image block but even with 'top align' thee was white space. I too tried adjusting line height but that feels more like a workaround than a permanent solution. This is why I hadn't thought to share a page since I was hoping there was a 'all scenarios' solution to aligning to its block.

Best, Robert

  • 1 month later...

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.