Jump to content

How to Have a header Image for Desktop only (not mobile)

Recommended Posts

Site URL: http://www.illiya.com

I have created a header Image on a site I'm building but it doesn't work visually for mobile. We want there to be no image on threader for mobile. I can't figure out how to code that...

This is the CSS I have for the header image:

.header-announcement-bar-wrapper {background-image:url('https://static1.squarespace.com/static/5ff4e40cc4c1da1088b8f730/t/604130fcb6044c2b87b97450/1614885117065/Website+Banner.jpg'); background-repeat:no-repeat; 
   border-bottom: 10px solid #00A1DA !important; background-size:cover;background-position: center;} .header {background-color:rgba(0,0,0,0)!important}

 

Please and thank you for any help!

Link to comment
  • Replies 2
  • Views 529
  • Created
  • Last Reply

You can add media query to code run on desktop only

@media screen and (min-width:768px) {
.header-announcement-bar-wrapper {background-image:url('https://static1.squarespace.com/static/5ff4e40cc4c1da1088b8f730/t/604130fcb6044c2b87b97450/1614885117065/Website+Banner.jpg'); background-repeat:no-repeat; 
   border-bottom: 10px solid #00A1DA !important; background-size:cover;background-position: center;} .header {background-color:rgba(0,0,0,0)!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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.