Jump to content

Bedford: How can I add an image to a page background?

Recommended Posts

  • Replies 13
  • Views 10.6k
  • Created
  • Last Reply

In Page Header Code Injection for the page at issue enter:


<style>body {  background-image: url("imageURL") !important;  background-repeat: no-repeat !important;}#siteWrapper {  opacity: 0;}</style>

Where imageURL is the link to your image.

If the image isn’t large enough to cover the page you’ll have to use repeat, repeat-x or repeat-y instead of no-repeat. For an expiation of these values see MDN’s background-repeat Article.

Let me know how this works for you.

I'm a retired attorney who was asked by a friend to build a website. In a prior lifetime, in a galaxy far, far away and long, long ago, I was a computer systems analyst / programmer. I'm a novice autodidact in CSS, JavaScript and HTML learning in part by example.. I've asked questions on this forum and been lucky enough to have others help me, so I'm inclined to answer any question I can. Pay it forward.

Link to comment

In place of opacity: 0; try substituting

background-color: transparent !important;

I'm a retired attorney who was asked by a friend to build a website. In a prior lifetime, in a galaxy far, far away and long, long ago, I was a computer systems analyst / programmer. I'm a novice autodidact in CSS, JavaScript and HTML learning in part by example.. I've asked questions on this forum and been lucky enough to have others help me, so I'm inclined to answer any question I can. Pay it forward.

Link to comment
  • 5 months later...
  • 7 months later...

@badhammermusic Please make sure that you are only adding answers to posts when you have an answer to provide. Otherwise, you will want to add your response as a comment. I've automatically converted this for you. Since you are asking a different question, you should consider opening a new post.

Link to comment
  • 3 weeks later...

@justin1024 I would like to use my background on only certain pages. Is there something I could add to my CSS

Here is the code i'm using now which works great on all pages.

siteWrapper {

background-image: url(http://lisel-larsoneicoff.squarespace.com/s/Eicoff-AloneSmaller6.jpg);
background-repeat: no-repeat; background-position: center top !important;background-image:url(static url)!important; background-repeat:no-repeat; background-attachment:fixed }

Thank you

Link to comment
  • 7 months later...

Archived

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

Guest
This topic is now 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.