where to put background in this code

Thread Solved

Join Date: Oct 2006
Posts: 90
Reputation: dami06 is an unknown quantity at this point 
Solved Threads: 0
dami06 dami06 is offline Offline
Junior Poster in Training

where to put background in this code

 
-1
  #1
Sep 23rd, 2009
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



HTML and CSS Syntax (Toggle Plain Text)
  1. <?
  2. $pagetitle = "WaCoCo: Waterloo Community Coalition";
  3. $pageid = "home";
  4. include('includes/functions.php');
  5. include('includes/header.php');
  6. ?>
  7. <?php
  8.  
  9. $dbcnx = @mysql_connect('localhost', 'root', 'bankside');
  10. if (!$dbcnx) {
  11. exit('<p> Unable to connect to the ' .
  12. 'database server at this time.</p> ');
  13. }
  14.  
  15. if (!@mysql_select_db('wacoco')) {
  16. exit('<p> Unable to locate the joke ' .
  17. 'database at this time.</p> ');
  18. }
  19.  
  20. $pages = @mysql_query("SELECT * FROM pages where id=1");
  21. if (!$pages) {
  22. exit('<p> Error retrieving categories from database!<br /> '.
  23. 'Error: ' . mysql_error(). '</p> ');
  24. }
  25.  
  26. while ($page = mysql_fetch_array($pages)) {
  27.  
  28. $maintext = $page["maintext"];
  29. $maintext = bbcode_format("$maintext");
  30. $sidebar1 = $page["sidebar1"];
  31. $sidebar1title = $page["sidebar1title"];
  32. $sidebar1 = bbcode_format("$sidebar1");
  33. $sidebar2 = $page["sidebar2"];
  34. $sidebar2 = bbcode_format("$sidebar2");
  35. $sidebar2title = $page["sidebar2title"];
  36. ?>
  37.  
  38. <div id="col1">
  39. <?
  40. //include('includes/getflickr.php');
  41. ?>
  42.  
  43. <h2> Welcome to WaCoCo</h2>
  44. <p> <? echo($maintext); ?> </p>
  45. <font color="#993300"> <h3> WaCoCo News</h3> </font>
  46.  
  47. </div>
  48. <div id="col2">
  49. <h2> <? echo($sidebar1title); ?> </h2>
  50. <p> <? echo($sidebar1); ?> </p>
  51. <h2> What's on</h2>
  52.  
  53. <? include('includes/frontpagetoday.php');
  54. ?>
  55. <p> <a href="/events"> Details of these events and more</a> </p>
  56.  
  57. </div>
  58. <div id="col3">
  59. <h2> <? echo($sidebar2title); ?> </h2>
  60. <p> <? echo($sidebar2); ?> </p>
  61. <?
  62. $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");
  63. if (!$news) {
  64. exit('<p>Unable to obtain news list from the database.</p>');
  65. }
  66. ?>
  67. <h2>Local news</h2>
  68. <div class="smallnavcontainer">
  69. <ul class="sectionnavlist">
  70. <?
  71. while ($newsrows = mysql_fetch_array($news)) {
  72. $newsid = $newsrows['ArtID'];
  73. $newstitle = $newsrows['ArtTitle'];
  74. $newsdate = date("j F Y",strtotime($newsrows[ArtDate]));
  75.  
  76. // Start The Background Check
  77. if($bgcolor == "#fff"){
  78. $bgcolor = "#eee";
  79. }else{
  80. $bgcolor = "#fff";
  81. }
  82. echo('<li class="smallnavlist" style="background-color:'.$bgcolor.';"> <strong> '.$newstitle.'</strong> <br/> '.$newsdate.'</li> ');
  83. }
  84. ?>
  85. </ul>
  86. </div>
  87. <p> <a href="/localnews"> See more local news</a> </p>
  88. </div>
  89. <?
  90. }
  91.  
  92. include('includes/footer.php');
  93. ?>
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: where to put background in this code

 
0
  #2
Sep 26th, 2009
Originally Posted by dami06 View Post
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.
Last edited by MidiMagic; Sep 26th, 2009 at 2:36 am.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 14
Reputation: webmaven is an unknown quantity at this point 
Solved Threads: 1
webmaven webmaven is offline Offline
Newbie Poster

Re: where to put background in this code

 
0
  #3
Oct 2nd, 2009
Here's the CSS code for that:

  1. body {
  2. background-color:#E2E8FE;
  3. background-image:url(images/backgroundimage.jpg);
  4. }
Last edited by peter_budo; Oct 3rd, 2009 at 6:06 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks).
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC