Jump to content

How to count project titles on portfolio page? - with counter increment -

Recommended Posts

Posted

Site URL: https://www.orsolyaoszabo.com/links

Hello, 

Anyone can help me fix this?

I wanna count the project titles on a portfolio page with a different font, and I'm figured out a css snippet which looks nice, only problem that it does not count the titles. Ideally, it would show "01" before the first one, "02" before the second one, and so on.

There might be some class name, I'm missing. 

 

Im using this snippet so far:

.portfolio-hover-item-content:before {
    content: "0" counter(menu-item-counter);
    font-family: poppins;
    font-style: normal;
    font-weight: 500;
    font-size: .825rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #161513;
    position: absolute;
    top: 40px !important;
    left: -28px;
}
.portfolio-hover-item-content{
    counter-increment: menu-item-counter;
    position: relative;
}

.portfolio-hover-item-content {
    counter-reset: menu-item-counter;
    justify-content: flex-start;
  }
 @media (max-width:991px){ .portfolio-hover-item-content:before {
    content: "0" counter(menu-item-counter);
    font-family: poppins;
    font-style: normal;
    font-weight: 400;
    font-size: .625rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #161513;
    position: absolute;
    top: 10px !important;
    left: -20px;
}}

www.orsolyaoszabo.com/links

 

Thanks a lot,

 

Orshi

 

 

  • Replies 2
  • Views 391
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

It looks like you figured it out?

<style>
 .portfolio-hover-item:before {
    content: "0"counter(portfolio-hover-item-counter);
    font-family: poppins;
    font-style: normal;
    font-weight: 500;
    font-size: .825rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #161513;
    position: absolute;
    top: 50px !important;
    left: -12px !important;
}
.portfolio-hover-item{
    counter-increment: portfolio-hover-item-counter;
    position: relative;
}

.portfolio-hover-item {
    justify-content: flex-start;
  }
  @media (max-width:991px){ .portfolio-hover-item:before {
    content: "0" counter(portfolio-hover-item-counter);
    font-family: poppins;
    font-style: normal;
    font-weight: 400;
    font-size: .625rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #161513;
    position: absolute;
    top: 20px !important;
    left: 0px !important;
}}
</style>

 

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

  • 2 weeks later...
Posted
On 2/7/2022 at 11:04 AM, tuanphan said:

It looks like you figured it out?

<style>
 .portfolio-hover-item:before {
    content: "0"counter(portfolio-hover-item-counter);
    font-family: poppins;
    font-style: normal;
    font-weight: 500;
    font-size: .825rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #161513;
    position: absolute;
    top: 50px !important;
    left: -12px !important;
}
.portfolio-hover-item{
    counter-increment: portfolio-hover-item-counter;
    position: relative;
}

.portfolio-hover-item {
    justify-content: flex-start;
  }
  @media (max-width:991px){ .portfolio-hover-item:before {
    content: "0" counter(portfolio-hover-item-counter);
    font-family: poppins;
    font-style: normal;
    font-weight: 400;
    font-size: .625rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #161513;
    position: absolute;
    top: 20px !important;
    left: 0px !important;
}}
</style>

 

YESS I did !! 

but thanks, anyway 🙂

 

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.