Jump to content

Change mobile styling on specific block

Go to solution Solved by tuanphan,

Recommended Posts

Hi,

I'm trying to target a specific text block on mobile so that I can adjust the text styling (from centre align desktop, to left align mobile), and other elements such as padding. Is there a way to target and style a block through CSS that doesn't affect all the other blocks?

Here's the site: https://www.rejectsupply.com/ Test123

The block I'm trying to style is called "H2 Text Block" on the site itself, (ID block-ce591823b8f1025afa01)

Thanks!

Edited by olipowell
Initial Revision
Link to comment
  • Solution

@olipowell add to Home > Design > Custom CSS


@media screen and (max-width:640px) {
div#block-ce591823b8f1025afa01 * {
   text-align: left !important;
}
div#block-ce591823b8f1025afa01 {
   padding-top: 10px !important;
   padding-bottom: 20px !important;
   padding-left: 30px !important;
   padding-right: 40px !important;
}
}


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
  • 2 years later...
On 10/5/2021 at 10:26 AM, Jeremyn said:

Hi Tuan,

 

Is there a way to raise the text block and the 2 CTA even more on this home page. (see photos)

I use : padding-top: 0px !important; but it doesn't go further up...

 

https://www.creativeportrait.net.au/

PS: Even better if I could bring the "FREE FAMILY GUIDE" button beside the other.

 

Screen Shot 2021-10-05 at .png

IMG_A357E74CFEA3-1.jpeg

Add to Design > Custom CSS

@media screen and (max-width:767px) {
div#page-section-5fa4db1fa27e0764adf5a839 {
    position: relative;
    top: -50px;
}
}

 

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
On 9/25/2021 at 4:58 AM, creedon said:

The following ruleset is causing the div to expand and cover the links. Take it out.

    #book-me {
        bottom:0;
        top: 75%;
        padding-right: 0px;
        transform: 0;
    }

Let us know how it goes.

Works perfectly. Thanks Tuan!

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.