Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Hod do I add a background image to Header wrapper ...

    v1.5.5f westminster_new responsive template

    Purpose is to have a large background image (filling the header wrapper) and such that the site logo and any navigation tab sits on top of that background image.

    I have searched this forum for help to add a background image to fill the header wrapper and have not found a simple complete solution - lots of maybe this, try that etc and most posts are years old. I have also searched for and found some css code (w3schools) for applying a background image - the problem being not knowing which files need to be modified to ensure the image is placed where required and that it loads correctly on all screens.

    The posts I found in different threads indicated individually modifying different files including stylesheet.css and some code in the header.php and something in a javascript as well in some with no positive outcome responded back by the questioner(s) that a particular solution worked ....

    unfortunately I didn't find one post that said, OK, follow steps a,b c and d indicating all changes that are required.

    So any assistance would be greatly appreciated.

    cheers, Mike

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Hod do I add a background image to Header wrapper ...

    You didn't post a URL, so one can only offer hypotheses without going and finding and downloading and installing that template ... which is a lot to ask. Much easier to just point to a specific site.

    Taking a guess, I looked at your Harmony site.
    You've got a 100% width white-background top-wrapper and top-middle div, both inside the #headerWrapper div. Those two 100%-width divs obscure any changes made to your #headerWrapper div.
    If those 100% width weren't 100%, and/or didn't have white-backgrounds then setting #headerWrapper {background-color: green} in the stylesheet would allow a green background to pass through. (starting with a bg color first before requiring any specific image; concept is the same)

    So, I'm guessing that whatever other unsatisfactory advice you said was offered previously was maybe actually totally right, but you have other things that are sitting on top and taking precedence over the other changes?

    In short, to make the #headerWrapper have a background image/color you'd set the CSS for it as I mentioned above.
    And then position other things as needed, making sure to not have other divs totally obscuring whatever is behind them.

    Using the browser's inspection tools lets you identify which files are affected for which screen sizes, and to test the changes in real-time. Thus the value of you sharing an actual URL in your post.

    Unfortunately your post doesn't give anything actionable to go on in order to help guide you past whatever you ended up with after following whatever unmentioned unsatisfying advice you tried.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Hod do I add a background image to Header wrapper ...

    Also, your huge logo.webp file doesn't work on all browsers, thus leaving a completely useless massive blank above-the-fold experience:

    Name:  Screen Shot 2020-11-02 at 7.50.26 PM.jpg
Views: 311
Size:  23.7 KB
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Hod do I add a background image to Header wrapper ...

    Firstly thanks for your speedy response and the heads up regarding the .webp logo, much appreciated - I will revert to previous .png

    Secondly maybe I didn't explain myself fully - I haven't sought advice / posted on this topic previously, I was referring to searches I did within the forums to try to find a correct method to implement a background image without simply just posting .... however I do appreciate your input about the 100% widths and having other divs obscuring others. I will rectify these.

    So here is some code I have found online for inclusion in the stylesheet.css - is this suitable for Zen-Cart application?

    Code:
    #headerWrapper {background: url(..includes/images/image.png) no-repeat; background-position: 100%; background-size: cover; opacity: 0.6;}
    and is this inserted in /*bof wrappers - page or section containers*/ in stylesheet.css ??

    obviously includes/templates/westminster_new/images/logo.png would have to be changeo to a small typical log stye and size if sitting over the background image?

    cheers,

    Mike

  5. #5
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Hod do I add a background image to Header wrapper ...

    Quote Originally Posted by shags38 View Post
    Firstly thanks for your speedy response and the heads up regarding the .webp logo, much appreciated - I will revert to previous .png

    Secondly maybe I didn't explain myself fully - I haven't sought advice / posted on this topic previously, I was referring to searches I did within the forums to try to find a correct method to implement a background image without simply just posting .... however I do appreciate your input about the 100% widths and having other divs obscuring others. I will rectify these.

    So here is some code I have found online for inclusion in the stylesheet.css - is this suitable for Zen-Cart application?

    Code:
    #headerWrapper {background: url(..includes/images/image.png) no-repeat; background-position: 100%; background-size: cover; opacity: 0.6;}
    and is this inserted in /*bof wrappers - page or section containers*/ in stylesheet.css ??

    obviously includes/templates/westminster_new/images/logo.png would have to be changeo to a small typical log stye and size if sitting over the background image?

    cheers,

    Mike
    Personally, I like using
    Code:
    background-position: center; background-size: contain, cover;
    centers and keeps the image responsive and not distorted. I also use my own stylesheet when adding such things so upgrading is easy and it helps with css rules... so bottom of stylesheet.css or stylesheet_MYTEMPLATE.css Also opacity is for anything displayed above the background, not the background image..
    Dave
    Always forward thinking... Lost my mind!

  6. #6
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Hod do I add a background image to Header wrapper ...

    Quote Originally Posted by davewest View Post
    Personally, I like using
    Code:
    background-position: center; background-size: contain, cover;
    centers and keeps the image responsive and not distorted. I also use my own stylesheet when adding such things so upgrading is easy and it helps with css rules... so bottom of stylesheet.css or stylesheet_MYTEMPLATE.css Also opacity is for anything displayed above the background, not the background image..
    Many thanks for the response Dave and the good advice. So what is calling the image? do I still need to include the url of the image like this?
    Code:
    #headerWrapper {background: url(../images/image.png) background-position: center; background-size: contain, cover;
    Obviously I am not good with CSS and templates :)

    cheers, Mike

  7. #7
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Hod do I add a background image to Header wrapper ...

    Quote Originally Posted by shags38 View Post
    Many thanks for the response Dave and the good advice. So what is calling the image? do I still need to include the url of the image like this?
    Code:
    #headerWrapper {background: url(../images/image.png) background-position: center; background-size: contain, cover;
    Obviously I am not good with CSS and templates :)

    cheers, Mike
    The only change was to the size and position... your full code
    Code:
    #headerWrapper {background: url(../images/image.png) no-repeat; background-position: center; background-size: contain, cover; opacity: 0.6;}
    Dave
    Always forward thinking... Lost my mind!

  8. #8
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Hod do I add a background image to Header wrapper ...

    Quote Originally Posted by davewest View Post
    The only change was to the size and position... your full code
    Code:
    #headerWrapper {background: url(../images/image.png) no-repeat; background-position: center; background-size: contain, cover; opacity: 0.6;}
    Many thanks Dave .... much appreciated.

    cheers,
    Mike

 

 

Similar Threads

  1. Add image to header wrapper?
    By jillcripps in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 26 Aug 2011, 11:55 AM
  2. How to add a background image to the header?
    By Twaddle in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Jan 2010, 01:10 PM
  3. Logo Wrapper Header Image
    By gixxer1000stunna in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 9 Sep 2009, 10:39 PM
  4. add background image to a attribute then have that background image act as hyperlink
    By sike1234 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 14 Nov 2008, 05:38 PM
  5. Background Image for Main Wrapper
    By charmedbytina2 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 11 Aug 2008, 10:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR