Jump to content
Go to solution Solved by tuanphan,

Recommended Posts

Hi there, 

I am inserting this code into a code block on my homepage to add text below my project titles but the new lines of text are not responsive on mobile. 

Can someone please add some code that will make this responsive on mobile screens? Thank you! 

 

<style>

 

 

 .portfolio-title:after{

 white-space:pre; 

 content:"\A Second Line";

 text-transform:titlecase;

 

}

 

 

.grid-item:nth-of-type(1) .portfolio-title:after{ white-space:pre; content:"\A Increasing long term user engagement & promoting habit formation" }

.grid-item:nth-of-type(2) .portfolio-title:after{ white-space:pre; content:"\A Providing flexible ordering services & fostering hobby enjoyment" }

 

 .portfolio-title:after{

white-space:pre; 

 content:"\A Anything";

  text-transform:titlecase;

  font-family:open sans;

  color:#1b1b1b;

  padding-top:.5rem

 

}

</style>

Link to comment
  • Replies 6
  • Views 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

Use this code

<style>
   .portfolio-title:after{

 white-space:pre; 

 content:"\A Second Line";

 text-transform:titlecase;

 

}

 

 

.grid-item:nth-of-type(1) .portfolio-title:after{ white-space:pre; content:"\A Increasing long term user engagement & promoting habit formation" }

.grid-item:nth-of-type(2) .portfolio-title:after{ white-space:pre; content:"\A Providing flexible ordering services & fostering hobby enjoyment" }

 

 .portfolio-title:after{

white-space:pre; 

 content:"\A Anything";

  text-transform:titlecase;

  font-family:open sans;

  color:#1b1b1b;

  padding-top:.5rem

 

}
  @media screen and (max-width:767px) {
   .portfolio-title:after {
     white-space: initial !important;
     font-size: 14px;
     display: block;     
 }
  }
</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!)

Link to comment

Hi thank you! 

It looks great on mobile however on desktop the font is a bit too large. Is there a way to decrease it? I tried changing the font size and that did not work. 

Please see the photo below as a reference. 

Thank you! 

Screenshot 2024-03-29 at 9.18.28 AM.png

Link to comment
  • Solution
On 3/29/2024 at 10:19 PM, Kaity said:

Hi thank you! 

It looks great on mobile however on desktop the font is a bit too large. Is there a way to decrease it? I tried changing the font size and that did not work. 

Please see the photo below as a reference. 

Thank you! 

Screenshot 2024-03-29 at 9.18.28 AM.png

Use this new code

<style>
    .portfolio-title:after{

 white-space:pre; 

 content:"\A Second Line";

 text-transform:titlecase;

 

}

 

 

.grid-item:nth-of-type(1) .portfolio-title:after{ white-space:pre; content:"\A Increasing long term user engagement & promoting habit formation" }

.grid-item:nth-of-type(2) .portfolio-title:after{ white-space:pre; content:"\A Providing flexible ordering services & fostering hobby enjoyment" }

 

 .portfolio-title:after{

white-space:pre; 

 content:"\A Anything";

  text-transform:titlecase;

  font-family:open sans;

  color:#1b1b1b;

  padding-top:.5rem

 

}
  @media screen and (max-width:767px) {
   .portfolio-title:after {
     white-space: initial !important;
     font-size: 14px;
     display: block;     
 }
  }
  @media screen and (min-width:768px) {
  .portfolio-title:after {
    font-size: 14px !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!)

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.