Header different on Desk/Tab & mobile
-
Hello. I have been through the forum and I have NO idea why this is so hard. I have tried various combinations of what I have found and I can’t make this work. I even tried just uploading the header through the standard customization options and making a special one for mobile (so only doing the mobile part below with !important and STILL I couldn’t get it to work.
Theoretically, to a layman, this “should” work but I’m obviously very wrong. I have two different images to use as a header. One for mobile view and one for desktops & tablets. Here is what I’m using:
/* header image on mobile */
@media screen and (max-width: 767px) {
.site-header {
background-image: url(https://staging1.delicatefabrics.net/wp-content/uploads/Web-Mobile-Header-600×154-px.png);}
}
@media screen and (max-width: 767px) {
.site-header .site-branding img{ max-height: 175px !important; }
.site-header .site-branding img{ max-width: 200px !important; }
.site-header .custom-logo-link { display: flex; align-items: center; }
.site-header .site-branding {
background-repeat: no-repeat;
margin:0 auto;}
}
@media screen and (max-width: 767px) { masthead { background-size: cover;
}
/* header image on desktop & tablet */
@media screen and (min-width: 768px) {
.site-header {
background-image: url(https://staging1.delicatefabrics.net/wp-content/uploads/WebsiteHeader.png)}
}
@media screen and (min-width: 768px) {
.site-header .site-branding img{ max-height: 175px !important; }
.site-header .site-branding img{ max-width: 200px !important; }
.site-header .custom-logo-link { display: flex; align-items: center; }
.site-header .site-branding {
background-repeat: no-repeat;
margin:0 auto;}
}
@media screen and (min-width: 768px) { masthead { background-size: cover;
}I’m so sorry, I really tried to do this without adding another question to your queue
The page I need help with: [log in to see the link]
- The topic ‘Header different on Desk/Tab & mobile’ is closed to new replies.