How to Embed Images as Background

>> Browse templatesMoney tips32 comments

Blogger Template Design: Tutorial 12

If you look at these templates - Lasik, JournallRed, and Minimalizt - you'd notice that the background is not of a plain color, but made from a repeating pattern of an image. This image is called a background image. It can be a single large image that fills up the screen or a small image (say 50 x 50 pixels) that repeats horizontally and/or vertically. The neat thing about using, or embedding, a background image is that you can create any image you like and use it in your blog to make it unique and different from other blogs.

A background image can be placed in any container - either inside the Body container (which fills up the entire screen), inside the Post, Sidebar, Comment, or even on a header container (say, a Comment Header). For example, if you look at the Minimalizt template, you'll see that the Comment Header below the post is a rounded green button - which is an image embedded inside the Comment Header.

You can also use an image to create a shadowy-looking side frame (now quite common in blogs). See the Hazy template to see how it looks. To do this, you create a short background image with a long span that fills the whole width of the template. At the right and left edge of the background image, you create the shadowy pattern (or any other pattern that you want to be the frame), and embed this inside the outer-wrapper container, repeating it vertically.

But, how to embed and how to repeat the image vertically, horizontally, or both in directions?


To Embed Background Image:

Say that you want to use a 100 x 100 pixels image as the background image inside the Sidebar1 container. What you need to do is find the sidebar1 {...} container in CSS Styling and add the following code in red (the other codes are just sample codes):

#sidebar1 {
margin: 0px 10px 15px 10px;
padding: 0 0 0 0;
width: 150px;
background: URL(http://the-url-of-your-image) repeat left top;
text-align: left;
}


The "background:..." code will embed whatever image at whatever URL you put and repeat the pattern both vertically and horizontally. The location of the starting image will be on the left-most side, and at the top-most position. The general command for embedding a background image is:

background: URL(http://...) repeat-command x-position y-position;



All Repeat Command:
  • no-repeat (the image won't be repeated at all)
  • repeat (repeat horizontally and vertically)
  • repeat-x (only repeats horizontally)
  • repeat-y (only repeats vertically)
All Horizontal (x) Position Command:
  • left (puts the starting image on the left-most side)
  • center (puts the starting image at the center)
  • right (puts the starting image on the right-most side)
All Vertical (y) Position Command:
  • top (puts the starting image on the top-most position)
  • center (puts the starting image at the center)
  • bottom (puts the starting image on the bottom-most position)

32 comments:

Teddy Hariadi July 09, 2007 11:13 PM  

Hi, What happen to your blog template? I saw that all of your template only contain 1 column.

Elque July 10, 2007 5:31 AM  

Hi, thanks for informing me. But, I saw that everything is okay, both in Firefox and IE7. All templates have 2 sidebars and 1 main column. Are you using different browsers?

Gourney Detoure© July 14, 2007 5:57 AM  

Hi

Pardon, but I dont seem to follow, what if you want to put an image/photo as yr complete background, instead of the simple color background provided by blogger?
Of course ones posts will cover the image partly but that would look good esp if you post a drawing to yr background.
Regards
G

Gourney Detoure© July 14, 2007 6:28 AM  

Retraction

It seems to work well, thanks alot, to see go to raumars.blogspot.com, its an experimental blog.
All I did was change 'background" (in Body) and nothing else and have an image hosted by someone.
Thanks, very appreciated.

Gourney Detoure© July 14, 2007 6:29 AM  

How are you with favicons?

And do yours work with IE7?

Elque July 15, 2007 2:41 PM  

gourney detoure,
I don't know how to use favicons yet, but all my templates have been tested well in IE7.

<a href="http://medonlineshops.com">OnlinePharmacy</a> October 26, 2007 2:03 AM  

ozdGF7 Your blog is great. Articles is interesting!

<a href="http://m1.aol.com/MacBoyd45/index1.html">efectos secundarios del viagra</a> October 26, 2007 11:05 AM  

fmUOhb Thanks to author.

<a href="http://m1.aol.com/IvySalas33/63_261007.html">meridia coupon</a> October 26, 2007 12:18 PM  

Good job!

<a href="http://members.ospa.us/portal_memberdata/portraits/trssnzrpi">columbus georgia motels</a> October 26, 2007 12:42 PM  

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

name October 27, 2007 12:19 PM  

Hello all!

<a href="http://basran.t35.com/index2.html">canyon tour zion</a> October 27, 2007 1:07 PM  

Good job!

<a href="http://users2.TitanicHost.com/finios/index9.html">dionne warwick tour</a> October 28, 2007 7:48 AM  

Magnific!

<a href="http://www.optimising.biz/portal_memberdata/portraits/turhsthao">buy phentermine and online</a> October 29, 2007 11:19 PM  

Please write anything else!

<a href="http://learning.hsc.hccs.edu/portal_memberdata/portraits/tnglpmobm">ringtones</a> October 30, 2007 2:33 AM  

Hello all!

<a href="http://www.bcrobotics.org/portal_memberdata/portraits/tunaqpwhm"></a> October 30, 2007 6:24 AM  

Nice Article.

<a href="http://m1.aol.com/EloyRowe59/128-291007.html">levitra review</a> October 31, 2007 11:37 AM  

7QBxe1 Good job!

<a href="http://freeringtones.99k.org/trying-to-find-free-ringtones-to-download-.html">trying to fin</a> October 31, 2007 12:05 PM  

Wonderful blog.

Jennifer June 10, 2008 1:12 PM  

Hi,
All of those sample sites are gone from Blogger! Could you give a new example please. Your site and templates are v useful, many thanks.

Eddie October 30, 2008 3:53 PM  

This is one of the best and informative post that i've read so far about designing a blogger theme. Thank you for sharing. Especially for someone is about to start a venture into desiging and creating websites, this give him/her a very good head start.
Thank you once again... Happy Bloggin.

Mai TrĂ¢m November 01, 2008 10:58 PM  

All of the links to view the sample templates are dead.

Jue Hairul May 27, 2009 5:59 AM  

TQVM..this tutorial was awesome..

good job

DoeHand June 16, 2009 12:24 PM  

Thanks for you motivations

Lauh September 07, 2009 11:52 AM  

Hello!
I tried lots os text aligns in my post but all of them stay in the left. If I selec some text and, as writing the post, center it, when I post it it always stays on the left.

Plus, I can't add the background image and I don't understand why. Do you think you coul help me?

Thanks

Stephanie Southard Photography November 19, 2009 6:44 PM  

I can't figure out how to embed a background. I read the tutorial and it sounds very simple but obviously I am doing it wrong! Can someone please help!! The only thing I can think of that I am doing wrong is that I accidentally erased the background code for the sidebar wrapper, so that is blank right now. Could that be my problem?

BubblyAsian November 30, 2009 5:16 AM  

I've placed a picture in the content section but it's not big enough. Is there a way I can resize it?

Moon January 26, 2010 4:28 PM  

Hi, I want know how put images in the outer-wrapper like this blog: http://love-puchie.blogspot.com/

thank you

ann April 24, 2010 3:30 AM  

hello friend.do you provide personal templates ? I have a blog as such which i would like to look much better at my own space.I somehow love all of your templates.Can you do one for me ? If so contact me at annammama@gmail.com

Administrator February 25, 2011 5:12 PM  
This comment has been removed by the author.
Administrator February 25, 2011 5:13 PM  

www.fanatictv.blogspot.com

abed November 12, 2011 1:51 AM  

Great Tutorial . . thanks

support December 01, 2011 2:12 AM  

nice tutorial very informatif but could you more spesfic on your tutoriial
cdi lite