Jump to content

Product Title's Font Style & Size on Product Page

Go to solution Solved by Edwardxu,

Recommended Posts

Site URL: https://www.edxulondon.com/shop/p/tears-marquise-ring

Hi All,

Is anyone able to advise me how to change the 2nd line of the Product title from H2 to P2? Basically the Title is broken into 2 lines by a line breaker 'I'. I want the 1st line to be in H2, and 2nd line to be in P2.

Please see the attachment for the example, and the title for this page is 'TEARS MARQUISE RING | Gold Vermeil & Rhodium Plated Silver'

Thanks for anyone would could help!

Ed

Screenshot 2021-12-22 at 17.53.14.png

Link to comment

We can't target second line. However we can change both first + second line. Then use another code to change first line, thus, both will have different style.

Add to Design > Custom CSS

/* Second Line + First Line */
h1.ProductItem-details-title {
    font-family: proxima-nova !important;
    font-weight: 300 !important;
    font-style: normal;
    letter-spacing: 0em;
    text-transform: none;
    line-height: 1.8em !important;
}
/* first line */
h1.ProductItem-details-title:first-line {
    font-family: Philosopher;
    font-weight: 700;
    font-style: normal;
    letter-spacing: .09em;
    text-transform: none;
    line-height: .9em;
}

 

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
5 hours ago, tuanphan said:

We can't target second line. However we can change both first + second line. Then use another code to change first line, thus, both will have different style.

Add to Design > Custom CSS

/* Second Line + First Line */
h1.ProductItem-details-title {
    font-family: proxima-nova !important;
    font-weight: 300 !important;
    font-style: normal;
    letter-spacing: 0em;
    text-transform: none;
    line-height: 1.8em !important;
}
/* first line */
h1.ProductItem-details-title:first-line {
    font-family: Philosopher;
    font-weight: 700;
    font-style: normal;
    letter-spacing: .09em;
    text-transform: none;
    line-height: .9em;
}

 

This works like a charm! Thank you so much!! 

Link to comment
On 12/23/2021 at 8:02 AM, tuanphan said:

We can't target second line. However we can change both first + second line. Then use another code to change first line, thus, both will have different style.

Add to Design > Custom CSS

/* Second Line + First Line */
h1.ProductItem-details-title {
    font-family: proxima-nova !important;
    font-weight: 300 !important;
    font-style: normal;
    letter-spacing: 0em;
    text-transform: none;
    line-height: 1.8em !important;
}
/* first line */
h1.ProductItem-details-title:first-line {
    font-family: Philosopher;
    font-weight: 700;
    font-style: normal;
    letter-spacing: .09em;
    text-transform: none;
    line-height: .9em;
}

 

Hi hope you are well. I am wondering if it's possible to adjust the font size of the second line? I would like to make it smaller, could you advise?

Link to comment
21 minutes ago, Edwardxu said:

Hi hope you are well. I am wondering if it's possible to adjust the font size of the second line? I would like to make it smaller, could you advise?

set font size for first code (it will set for first line + second line)

next, set font size for second code (it will set for first line)

The code uiwll be like this

/* Second Line + First Line */
h1.ProductItem-details-title {
    font-family: proxima-nova !important;
    font-weight: 300 !important;
    font-style: normal;
    letter-spacing: 0em;
    text-transform: none;
    line-height: 1.8em !important;
font-size:20px;
}
/* first line */
h1.ProductItem-details-title:first-line {
    font-family: Philosopher;
    font-weight: 700;
    font-style: normal;
    letter-spacing: .09em;
    text-transform: none;
    line-height: .9em;
font-size: 30px;
}

 

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
3 hours ago, tuanphan said:

set font size for first code (it will set for first line + second line)

next, set font size for second code (it will set for first line)

The code uiwll be like this

/* Second Line + First Line */
h1.ProductItem-details-title {
    font-family: proxima-nova !important;
    font-weight: 300 !important;
    font-style: normal;
    letter-spacing: 0em;
    text-transform: none;
    line-height: 1.8em !important;
font-size:20px;
}
/* first line */
h1.ProductItem-details-title:first-line {
    font-family: Philosopher;
    font-weight: 700;
    font-style: normal;
    letter-spacing: .09em;
    text-transform: none;
    line-height: .9em;
font-size: 30px;
}

 

Thanks for the new code. At the moment, I can only adjust the first line of the title by changing the size for the second code. I want to make the second line of the title smaller (almost same size as the product description), It does not seems to be working by changing the font size in the first code. Could you help?

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.