I'm not sure where to put my background image in this code and how to make the image transparent. Could you please help me out. Thank you

$pagetitle = "WaCoCo: Waterloo Community Coalition";
$pageid = "home";

$dbcnx = @mysql_connect('localhost', 'root', 'bankside');
if (!$dbcnx) {
  exit('<p>Unable to connect to the ' .
      'database server at this time.</p>');

if (!@mysql_select_db('wacoco')) {
  exit('<p>Unable to locate the joke ' .
      'database at this time.</p>');

$pages = @mysql_query("SELECT * FROM pages where id=1");
if (!$pages) {
  exit('<p>Error retrieving categories from database!<br />'.
      'Error: ' . mysql_error(). '</p>');

while ($page = mysql_fetch_array($pages)) {

$maintext = $page["maintext"];
$maintext = bbcode_format("$maintext");
$sidebar1 = $page["sidebar1"];
$sidebar1title = $page["sidebar1title"];
$sidebar1 = bbcode_format("$sidebar1");
$sidebar2 = $page["sidebar2"];
$sidebar2 = bbcode_format("$sidebar2");
$sidebar2title = $page["sidebar2title"];

<div id="col1">

	<h2>Welcome to WaCoCo</h2>
	<p><? echo($maintext); ?></p>
	<font color="#993300"><h3>WaCoCo News</h3></font>

<div id="col2">
	<h2><? echo($sidebar1title); ?></h2>
	<p><? echo($sidebar1); ?></p>
		<h2>What's on</h2>

<?	include('includes/frontpagetoday.php');
<p><a href="/events">Details of these events and more</a></p>

<div id="col3">
	<h2><? echo($sidebar2title); ?></h2>
	<p><? echo($sidebar2); ?></p>
	$news = @mysql_query("SELECT ArtID, ArtTitle, ArtDate FROM Article WHERE ArtMsg LIKE '%Waterloo%' OR ArtTitle LIKE '%Waterloo%' OR ArtLead LIKE '%Waterloo%' ORDER BY ArtID DESC LIMIT 0,2");
  if (!$news) {
    exit('<p>Unable to obtain news list from the database.</p>');
 <h2>Local news</h2>
<div class="smallnavcontainer">
<ul class="sectionnavlist">
 while ($newsrows = mysql_fetch_array($news)) {
    $newsid = $newsrows['ArtID'];
    $newstitle = $newsrows['ArtTitle'];
    $newsdate = date("j F Y",strtotime($newsrows[ArtDate]));

        // Start The Background Check 
        if($bgcolor == "#fff"){ 
            $bgcolor = "#eee"; 
            $bgcolor = "#fff"; 
echo('<li class="smallnavlist" style="background-color:'.$bgcolor.';"><strong>'.$newstitle.'</strong><br/>'.$newsdate.'</li>');
<p><a href="/localnews">See more local news</a></p>

8 Years
Discussion Span
Last Post by webmaven

I'm not sure where to put my background image in this code and how to make the image transparent. Could you please help me out. Thank you

The background image url belongs in a style for the body tag.

I am not sure what you mean to make the image transparent. The background is supposed to be on the bottom, so there should be nothing under it to be seen through it.

If something is fully transparent, you can't see it.

If you intend to make the image very light and barely visible (like a watermark), you need to modify the image with your graphics editor before you upload it to the web server. Adjust the brightness and contrast of the image to get this effect.

There is nothing in standard html/css that allows an image to be partly transparent. There are some nonstandard features that do not work on all browsers. And there are scripts that do not work on all computers.

I still do not see why you want a transparent image.

Edited by MidiMagic: n/a


Here's the CSS code for that:

body {

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.