Twitist Forums
How do I use this code to make a background image instead of a background color? - Printable Version

+- Twitist Forums (http://twitist.com)
+-- Forum: Facebook forums (/forum-14.html)
+--- Forum: Facebook apps (/forum-22.html)
+--- Thread: How do I use this code to make a background image instead of a background color? (/thread-50545.html)



How do I use this code to make a background image instead of a background color? - obedientisland923 - 12-12-2012 06:54 PM

I am making a profile on a facebook application, but I don't know much about html. I experimented by looking at the page source and found this:

<br /></div>
<br />
<br /></table>
<br /><div style="background-color: Black;">
<br /><center>
<br /><center><font size="4" color="white" font=”impact”><table style="background: transparent url("http://i532.photobucket.com/albums/ee329/siva0eminencija/untitled-1.jpg") repeat scroll 0% 0%;" valign="center" border="0" width="620" height="600"><td>


along with a bunch of other stuff. when i entered it into my profile it worked, my background became black. however, i'd like to use a background image from a url instead of just the black background? is that possible? also, is some part of this code unnecessary such as the "br"s? what do all the parts mean and how can i change them. thanks


- Kai - 12-12-2012 07:02 PM

For a background image use: <body background="URL">

To find the url of an image:
Firefox: Right click on the image and select "copy image location."
IE: Right click on the image, select properties, and copy the URL after the "location" header.

<br> means break, which is essentially like hitting enter on Microsoft Word.


- Alaric - 12-12-2012 07:02 PM

Use something like this

<body background="file.jpg" bgcolor="#111111">

or

<body background-image:url("IMG URL HERE")>

br is a break in html it just makes a blank space like hitting the enter key in wordpad


- skahoj - 12-12-2012 07:02 PM

Yes, it should work. Change the line that says:

<div style="background-color: Black;">

to:

<div style="background: url(adress of image goes here) no-repeat;">

You can change the font size- a larger number will make it bigger, a lower number will make it higher. Impact is the typeface, so you can change that but only use system fonts (the ones that came pre-loaded on your computer) or else other people might not be able to see it. I wouldn't change anything else if I were you.


- melodiccoil173 - 12-12-2012 07:02 PM

The part "<div style="background-color: Black;">" set the background black. Change black to color you want to use. Example:

"<div style="background-color: blue;">

There's two center tags which is a no-no. Your link to image didn't come out so this is just a guess:

<center><font size="4" color="white" font=”impact”>

<table style="background: transparent url("URL of Image Here) repeat 0% 0% scroll;" valign="center" border="0" width="620" height="600"><td>

The "<br>"s are line breaks used for separation of items. Causes a break to a new line for content following it. Some may be removed, but I wouldn't even try to tell you with so little to work from. Of course, your "br />" tags didn't show up and those are done the wrong way anyway.

Font tags have been out of use for ages.

Your table is the one that has the background image in it. If it worked as you said, don't move that code to the div container.

Ron