Jump to content

How to affix blog categories to posts as "tabs"?

Recommended Posts

Site URL: https://sphere-earthworm-5t8a.squarespace.com/

Hi there!

I'm currently developing a site for a client with a blog – for each blog post, the client would like to have the post's category as a styled "tab" fixed and centered at the top of the post (I've attached the wireframe as an example). The password for the site is oakandstone2021, as it isn't live yet.

I'm using the below CSS, which appears to get these tabs to happen, but they aren't responsive or staying fixed to the post at different screen sizes: .blog-categories {background: #DDD4C9; padding: 8px 20px; position: relative; top: -460px}

Any help would be greatly appreciated – thanks so much! 
 

Blog Category Tags Design.png

Link to comment
  • Replies 4
  • Views 370
  • Created
  • Last Reply

Top Posters In This Topic

On 9/24/2021 at 3:02 AM, tuanphan said:

Hi,

It looks like you done style for tags. Do you still need help to make tag overlap top of image?

Hi there, yes! Help would still be appreciated – the CSS styles I applied add the tags to the top of the image, but they float off of the images on scroll. Any advice on gettin the tag to stay fixed on top of the image across different devices sizes would be amazing.

Thanks so much! 

Link to comment
On 9/28/2021 at 9:37 PM, lindsayscholz said:

Hi there, yes! Help would still be appreciated – the CSS styles I applied add the tags to the top of the image, but they float off of the images on scroll. Any advice on gettin the tag to stay fixed on top of the image across different devices sizes would be amazing.

Thanks so much! 

Don't remove any code.

Add this CSS

.blog-categories {
    position: absolute;
    top: -15px !important;
    left: 50% !important;
    transform: translateX(-50%);
}

image.thumb.png.2bf90fbc603311daf617380d65a92dbf.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...

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.