How to add background image with code?
-
Hi there,
When a I google “blog backgrounds” I come up with links like these.
http://myblogmakeover.blogspot.com/2009/06/american-flag.html
The instructions on this page say to copy a certain code and put it in the “html gadget on your sidebar”. I haven’t been able to find a tool like that in WordPress. Is it possible to use html code for background images in WordPress?
The blog I need help with is: (visible only to logged in users)
-
Many themes allow us to upload images to use as a background or to set a color of our choice. http://theme.wordpress.com/themes/features/custom-background/
All you need to do is capture the image and upload it > Appearance > Background -
I know it’s possible to upload photos, but I’d rather use the code. The sites that provide the free blog backgrounds don’t give a high-res photo, only code.
-
I’m sorry but you can’t do that. We cannot edit templates and themes on WordPress.com blogs.
-
Also, having a background image pulled from elsewhere on the web will typically slow your site down for visitors since their browser then has to not only download everything for your blog, but it also has to go and get the image from a totally different website.
-
-
Can you post a sample of the code they are giving you here between “code” tags?
<code>all the code here</code>
G’day TT.
-
-
Thesacredpath, the code looks like this:
<style type=”text/css”>body {background-image: url(“http://i454.photobucket.com/albums/qq269/carolynnreynolds/Vintage-Flag.jpg”); background-position: center; background-repeat: no-repeat; background-attachment: fixed; }</style><div id=”tag” style=”position:absolute; left:0px; top:30px; z-index:50; width:150px; height:45px;”><img border=”0″ src=”http://i454.photobucket.com/albums/qq269/carolynnreynolds/DFI-Sponsor.png” /></div><div id=”tag” style=”position:absolute; left:0px; top:80px; z-index:50; width:150px; height:45px;”><img border=”0″ src=”http://i454.photobucket.com/albums/qq269/carolynnreynolds/Designed-by.png” /></div><img src=”http://i454.photobucket.com/albums/qq269/carolynnreynolds/ILOVeMYBLOGMAKEOVERBUTTON.gif” />
There’s also another background I might like to use with this code:
<script>document.write(unescape(“%3Cstyle%20type%3D%22text/css%22%3E%0Abody%20%7B%20background-image%20%3A%20url%28%22http%3A//thecutestblogontheblock.com/backgrounds/zrusticpatrioticstripescopy.jpg%20%22%29%3B%20background-position%3A%20center%3B%20background-repeat%3A%20no-repeat%3B%20%20background-attachment%20%3A%20fixed%3B%20%7D%0A%3C/style%3E%0A%3Cscript%20type%3D%22text/javascript%22%3E%0Avar%20div%20%3D%20document.createElement%28%27div%27%29%3B%0Adiv.setAttribute%28%27style%27%2C%22position%3A%20absolute%3B%20left%3A%200px%3B%20top%3A%2030px%3B%20z-index%3A%2050%3B%20width%3A%20150px%3B%20height%3A%2045px%3B%22%29%3B%0Adiv.innerHTML%20%3D%20%27%3Ca%20target%3D%22_blank%22%20href%3D%22%20http%3A//www.thecutestblogontheblock.com%22%3E%3Cimg%20border%3D%220%22%20src%3D%22http%3A//www.thecutestblogontheblock.com/images/tag.png%22%3E%3C/a%3E%27%3B%0Adocument.getElementsByTagName%28%27body%27%29.item%280%29.appendChild%28div%29%3B%0A%3C/script%3E”));</script>
Unfortunately, I don’t see a photobucket url in there.
- The topic ‘How to add background image with code?’ is closed to new replies.