Kaity Posted March 24 Share Posted March 24 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
tuanphan Posted March 26 Share Posted March 26 Can you share link to portfolio page? 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
Kaity Posted March 26 Author Share Posted March 26 Yes of course! https://www.kaitykuzeljevic.com/ Link to comment
tuanphan Posted March 29 Share Posted March 29 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
Kaity Posted March 29 Author Share Posted March 29 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! Link to comment
Solution tuanphan Posted March 31 Solution Share Posted March 31 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! 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
Kaity Posted March 31 Author Share Posted March 31 Amazing! This looks great. Thank you so much for your help!! tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment