Jump to content

@media queries dont run on my squarespace 7.1 and i dont know why

Go to solution Solved by paul2009,

Recommended Posts

Site URL: https://www.phyo.es

Hi my friend, im trying to add a vertical line on my website.

I use this code: 

<div class="home__verticalline">
</div>

<style>
  .home__verticalline {
    position: absolute;
    height: 2200px;
    border-left: 1px solid #d6ccc4;
    left: 50%;
  }
</style>

But I want to hide it when im on mobile so I add this media query:

<style>
@media only screen and (max-width: 700px) {
    .home_verticalline {
    display: none;
    }
  }
</style>

I think my code is OK, but when I check the website on mobile the "media query" doesn't run.

I add some screenshots.

Could you help me, please??

Captura de pantalla 2021-04-15 120757.png

Captura de pantalla 2021-04-15 120853.png

Captura de pantalla 2021-04-15 120928.png

Captura de pantalla 2021-04-15 121034.png

Link to comment

You should add it to Design > Custom CSS, without the <style></style> tags, not to code injection.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
1 hour ago, Phyo said:

Do you know some another solution?

Please share the public password that you've set, so that we can take a look at the page. This will make it easier for the community to provide an accurate answer.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
  • Solution

You appear to be missing an underscore within the media query.

It should be .home__verticalline not .home_verticalline.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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.