Follow Herdboy.com

Adding a Background Image to Your Joomla Articles

Here's how you can achieve this

 

In this tutorial we are going to show you how to add a background image to an article on your website with some CSS code. The code is inserted into your article itself. You can use the sample code provided to apply this CSS background individually to articles that you choose so we are not going to insert any code into our template to apply it universally to all articles. This will give you more freedom of choice by easily applying different backgrounds and styles to articles that you choose.

You may have to insert the sample code into your content without using your WYSIWYG Editor, becasue some configurations of WYSIWYG will strip out or alter your code so you do not get the desired result ( They are evil little things at times )

If you look at the bootom of this page, you will see an example of how this same code is applied to a custom Html module to manipulate the background.

Here is the code that was used in this article, Replace all the plus signs " + " with " < " or " > " as required.
+div class="floatbox" style="background: transparent url(FULL PATH TO IMAGE.png) repeat scroll 0% 0%; width: 700px; height: 497px;">
+div align="left">+/div+
+div style="margin: 0px;">
+div align="left">+/div+
Here's how you can achieve this

In this tutorial we are going to show you how to add a background image to an article on your website with some CSS code. The code is inserted into your article itself. You can use the sample code provided to apply this CSS background individually to articles that you choose so we are not going to insert any code into our template to apply it universally to all articles. This will give you more freedom of choice by easily applying different backgrounds and styles to articles that you choose.

+/div+

+/div+



Comments (28)add comment

mustaq said:

mustaq
...
Make a post on our Support Forum and we will take it from there smilies/wink.gif
 
November 25, 2009
Votes: +0

Mike Cross said:

Mike Cross
no good
The only way it works is with the over and over again look. But I did find a FREE software that almost did the transparent thing. I am using a MAC, is there any FREE software to make my pic look like the example pic?
 
November 25, 2009
Votes: +0

mustaq said:

mustaq
...
Use this code to prevent the repeating of the background image;


open)div style="background: transparent url(images/Bands/prophecy.jpg) none repeat scroll 0% 0%; width: 700px; height: 497px;"(close)
(open)div style="background: transparent url(images/Bands/prophecy.jpg) none repeat scroll 0% 0%; width: 700px; height: 497px;"(close)...
 
November 25, 2009
Votes: +0

Mike Cross said:

Mike Cross
(open)div style="background: transparent url(images/Bands/prophecy.jpg) repeat scroll 0% 0%; width: 700px; height: 497px;"(close)
(open)div style="background: transparent url(images/Bands/prophecy.jpg) repeat scroll 0% 0%; width: 700px; height: 497px;"(close)...

you know with the greater than and less than signs. They will not show up when I past the code.
 
November 24, 2009
Votes: +0

Mike Cross said:

Mike Cross
my code


So I need to make the pictures transparent myself?

This is the page I am working on: http://turnmusicn2money.com/in...&Itemid=29
 
November 24, 2009
Votes: +0

mustaq said:

mustaq
...
Hi Mike

I am not clear on how to make the background images transparent.

The images you see here looks transparent because it was edited with an images Editor, like Fireworks or Photoshop. It is not the script responsible for that. You need to drop the transparency levels on your image.

the picture is showing up, but it's over and over again

You need to define a width and height for the image, or else it will repeat. What does your code look like ?

style="background: transparent url(FULL PATH TO IMAGE.png) repeat scroll 0% 0%;
 
November 24, 2009
Votes: +1

Mike Cross said:

Mike Cross
why background images are not Transparent????
It's has been all day. And I am not clear on how to make the background images transparent. the picture is showing up, but it's over and over again and it's not transparent. I don't mind the over and over again pictures, but I have to have the back ground transparent. Can't read the front ground wording.

Can someone please help?
 
November 24, 2009
Votes: +0

mustaq said:

mustaq
Image
Yes, I can but its a very low res image that I found on the net. If you really need it , I can dig it up again.smilies/wink.gif
 
July 30, 2009
Votes: +1

cicalone said:

Roberto Massi
Thanks
Excellent job. Very useful for me!
Can you share the hearts image you put in your example?
 
July 30, 2009
Votes: +0

malek said:

0
Thanks
wow. thank you smilies/smiley.gif
 
June 25, 2009
Votes: +2

mustaq said:

mustaq
...
I will put up something as soon as I can clear up my desk.smilies/smiley.gif
 
June 08, 2009
Votes: +3

malek said:

0
Please example with pattern
Hi

Where is the example with patterns(repeat) that you once had here? it was nice and exactly what I need - please repost it. No, its easier to look at the code from your example than mutating the above for a newbe. thx mate
 
June 08, 2009
Votes: +0

mustaq said:

mustaq
Fixed background with Scroll
Hi

Yes, this can be easily done as well, I will post another tutorial with some sample code for you soon, I just need to clear my desk first.smilies/wink.gif
 
May 27, 2009
Votes: +3

Ivan888 said:

0
...
Thanks, this worked really fine...but is there a way to make the background fixed? Like a fixed background and scrolling text only. Thnx
 
May 27, 2009
Votes: +0

mustaq said:

mustaq
Hearts
Thanks for the comments, Are you looking for the hearts module you see here ?
 
May 21, 2009
Votes: +1

tato said:

0
...
thanks for sharing. please the hearts.
 
May 21, 2009
Votes: +0

mustaq said:

mustaq
Thanks
Thanks for the appreciation, we will be looking at a more comprehensive tutorial shortly, with more relevant examples and applicationssmilies/wink.gif
 
April 11, 2009
Votes: +3

mind power said:

0
...
I would like to appreciate the efforts you have made in writing this article and i am hoping the same good work from you in the future as well.
 
April 11, 2009 | url
Votes: +0

mustaq said:

mustaq
Yes, You can
This is possible. You will need to add the relevant code to your temlates CSS, thereby creating sort of module styling that can be applied in the modules parameter setting for modules or in the article itself via the WYSIWYG.
 
April 07, 2009
Votes: +1

AlexEnergy said:

0
How to convert an UPLOAD IMAGE to background-image

I wonder if there is a possibility to use a class or style to transform a normal to image to background-image.

My purpose is to make it easy for my users to upload images for background-image without knowledge of html.

My user press the button of image in editor, he uploads the image and then I have to tell him an easy way to transform the image to background-image.

 
April 06, 2009
Votes: +1

mustaq said:

mustaq
...
thanks for sharing. bookmarked


You are welcome. We will be putting up a few more examples , to show some of the more creative applications of this tutorial, once we are done with the site redesign and layout.
 
March 26, 2009 | url
Votes: +3

stippke said:

0
nice done
thanks for sharing. bookmarked smilies/grin.gif
 
March 26, 2009 | url
Votes: +2

mustaq said:

mustaq
Version
What version of IE are you seeing this with ? I don't see any difference with IE 7 or IE8. I may be overlooking something. Can you describe it more ? or post a screenshot on the forums ?
 
March 18, 2009
Votes: +2

Avo said:

0
IE/Firefox
Thanks a lot, this is really useful!
There is a slight difference in visualisation between IE and firefox (not so bad). In IE the text is moved a bit. Any ideas how to resolve this issue?
 
March 17, 2009
Votes: +1

herdboy said:

herdboy
Lets See
Are you using any type of SEF/ SEO extension or plugin on your site ? Have you tried both absolute and relative URL's to link the image ? This could be the most likely cause of your issue. Can you post a link to your site ?
 
March 13, 2009
Votes: +1

Mo Kelly said:

0
Works in editor not on site
I can get the background picture in the editor when I do this but nothing shows for the background on the site when the article is displayed on the front page.
 
March 13, 2009 | url
Votes: +0

mustaq said:

mustaq
Yes You Can
Yes this is also possible. See the example at the bottom of this pagesmilies/smiley.gif . This will allow you to style the content of custom modules even further. If your template has different module stylings you can still use this and apply a background image to suit it.
 
March 13, 2009 | url
Votes: +3

gery said:

0
will this work for a custom module?
will this work for a custom module? this will be great if it works inside a custom joomla module, just imagine the posibilities wit this!
 
March 13, 2009
Votes: +1

Write comment

busy
 
 
 
     This is some content that is placed in a normal Joomla Custom module with a small image repeating.

   So you can also have a custom background for modules that allow you to add your own html