943,823 Members | Top Members by Rank

Ad:
Sep 23rd, 2009
-1

where to put background in this code

Expand 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



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. ?>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
dami06 is offline Offline
90 posts
since Oct 2006
Sep 26th, 2009
0

Re: where to put background in this code

Click to Expand / Collapse  Quote originally posted by dami06 ...
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.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Oct 2nd, 2009
0

Re: where to put background in this code

Here's the CSS code for that:

css Syntax (Toggle Plain Text)
  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).
Reputation Points: 10
Solved Threads: 1
Newbie Poster
webmaven is offline Offline
18 posts
since Sep 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: CSS mozilla problems
Next Thread in HTML and CSS Forum Timeline: no file extension required





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC