Adding a background image in php

Hey guys, i have a php file on which i need to add a background image to better coordinate my website and i can´t remember the code and where it goes. Could someone help ?
thanks guys.

I think the two links from w3schools should show you.  Or go to any straightforward web page and use your browser to view source and take a look at someone elses page.  Or get to grips with a Firefox plug-in called Firebug.  Or just read any basic CSS tutorial.
If you can post a link to your page it will be easy for someone here to show you but in my opinion, this is one you ought to work out for yourself.  A consistant piece of advice regularly given here by the experts is to learn HTML and CSS if you want to get to grips with DW.
Having said that, DW will hold your hand a little if you use it's tools for writing CSS.  http://www.adobe.com/devnet/dreamweaver/css.html
martin

Similar Messages

  • Random background-image with PHP

    I would like to have random images as background-images on a
    page. So I
    made a rotate.php ("SELECT picsid, picsurl FROM pics WHERE
    picsite =
    'home' ORDER BY MD5(RAND()) limit 1") with
    <img src="<?php echo $row_rsimages['picsurl']; ?>"
    alt="" />
    Then I put the following rule into the css-file:
    #pics {
    width: 400px;
    height: 200px;
    background-color: #fff;
    background-image: url(banner.php);
    background-repeat: no-repeat;
    background-position: top left;
    Finally I inserted a div called #pics on the index.php and
    previewed the
    page, and - you are right ;) - the images are not displayed.
    Where have I failed?
    Martin Lang

    Martin Lang wrote:
    > I would like to have random images as background-images
    on a page. So I
    > made a rotate.php
    > background-image: url(banner.php);
    > Where have I failed?
    In several places.
    1. Presumably banner.php is the page that you earlier refer
    to as
    rotate.php. The name should be the same.
    2. It looks as though you're trying to use an <img> tag
    to display a
    background image. That won't work.
    3. If you want banner.php to display an image, you need to
    send the
    correct MIME header and stream the image as a download.
    // code to select the image
    $filepath = '/home/mysite/htdocs/images/'; // path to image
    folder
    $image = $filepath.$row_rsimages['picsurl'];
    if (file_exists($image) && is_readable($image)) {
    $size = filesize($image);
    header('Content-type: image/jpeg');
    header('Content-length: '.$size);
    $file = @fopen($image, 'rb');
    if ($file) {
    fpassthru($file);
    It's actually a lot simpler to do everything in the same
    page.
    Put the recordset at the top of the page to select the random
    image.
    Then put the style block in the head of the document:
    <style type="text/css">
    #pics {
    width: 400px;
    height: 200px;
    background-color: #fff;
    background-image: url(<?php echo $row_rsimages['picsurl'];
    ?>);
    background-repeat: no-repeat;
    background-position: top left;
    </style>
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Adding a background image with HTML?

    Just a quick one. Want to add a background image to the html
    of a flash site so the background image can scale and the content
    of the flash site not scale. Any ideas anyone??
    Thanks all!

    satrop wrote:
    > Just a quick one. Want to add a background image to the
    html of a flash site so the background image can scale and the
    content of the flash site not scale. Any ideas anyone??
    You can place the image in flash. Flash has onResize handler
    which in conjunction with
    listener, can detect the changes in stage, scale movie to
    fill the window while preventing
    other content from scaling. This is very common, when we
    resize background to fill window
    but hold the content intact. Try to search the forum for
    "onResize". That's the only case,
    in most posts, where we deal with the exact same issue as the
    one you looking for.
    Best Regards
    Urami
    "Eat one live toad in the morning and nothing worse will
    happen to you for the rest of the day."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Adding 2 background images

    Hello all!
    I'm trying to figure out if this is possible..
    I have 1 repeat-x image to the body that acts as a gradient background but then I would like to add a second background image with repeat-x again. I need both images to repeat at 100% width behind all the other elements, like header, container etc. But it seems I can use only 1 background image in body.
    Is there a way to add 2?

    Since you want it to go behind everything, just create a div that wraps around your content, and apply the background to that.
    body {
      background-image: url('images/imageA.jpg');
      margin: 0;
      padding: 0;
    #wrapper {
      width: 100%;
      background-image: url('images/imageB.jpg');
      margin: 0;
      padding: 0;
    <body>
    <div id="wrapper">
      All your page content goes here
    </div>
    </body>

  • Adding a background image to every page.

    Problem:  I am attempting to add a company logo (.jpg) file to a multipage PDF document.  I know I can add the logo as a stamp but I need the logo to be on every page in the same position and with the same size.  I was hoping that using it as a watermark would be the answer but I can't seem to get it to work.  It would be great to be able to add it in the header section but it is not an option either (so I think).  Please let me know if there is any tricks I can learn to accomplish what I am seeking to do.  I would be willing to upgrade to Acrobat Pro X if needed.
    Background:  I am running Mac OS X (10.6.7) and Adobe Pro 9.  The issue I am running into involves a file in Microsoft Excel 2008 that contains multiple pages of spread sheets and charts/graphs.  In Excel, I add the company logo to the header section and it shows up on all pages.  When I go to print out the document some of the pages need to "Shrink to fit" and when they shrink so does the logo.  Ok, take the logo out of those pages, done.  Next, on the pages that have graphs and visual charts the logo appears on the computer but is hidden behind the visual graphic when you save as a PDF.
    That said, I have a well functioning PDF but after saving from Excel only some of the pages have the company logo on them while the others do not.  I need to have the logo on all pages in order to send as a digital version (company requires it).  My only solution right now is to print out the pages (not containing company logo) on pre-printed paper containing the logo and then scan those pages back in digitally and add them back into my PDF document.  Not only is this method time consuming but it also cuts up the PDF into a on OCRed type of PDF.
    Can't wait to hear your replies on this one!
    I really appreciate your help.  Feel free to contact me directly or via the forum with any questions.
    Best,
    Brent
    [email protected]

    Boy that makes a lot of sense.  There must be something up with my file in regards to adding a watermark.  When I have my document open in Adobe Acrobat 9 and I try to add a watermark I receive the following error.
    "An error was encountered while retrieving page content."
    I open a different document that I don't care to add the watermark to and it opens fine.  I think your answer to use watermarks is spot on.  I need to see if Adobe Acrobat X will allow me to add a watermark to my file.
    - Brent

  • Adding background image to Spry Menu Bar?

    Hi Everyone,
    I have a question concerning adding a background image to a horizontal spry menu.
    1) I am using Dreamweaver CS4.
    2) I am inserting this menu bar on a HTML document.
    3) I have created and am using an external style sheet (CSS)
    I am not sure on which style(s) ("ul.*) to edit in order to acheive this.
    I have a total of four(4) different images I would like to use, they are...
    1) Horizontal Menu Bar (main menu bar)
    2) Horizontal Menu Bar - Rollover
    3) Submenu
    4) Submenu - Rollover
    Also I would like the text to be centered on the button.
    I have somewhat acheived this using the instructions for "customize this widget", yet the image "repeats" because the button is larger than the image.
    I have not tried to center the text, this may be a very simple thing, if so just let me know.
    What I dont know, and was hoping someone could tell me, is which style(s) ("ul.*) to edit in order to acheive this.
    If anyone needs anymore information, just let me know and I will give it to you as soon as possible.
    Also I have attached three(3) of the four(4) pictures I would like to use. (this is the maximum)
    Any help will be greatly appreciated,
    Musicman1994

    I'd like to thank everyone with their help so far, but I am still having trouble.
    I have tried both suggestions and the results are...
    The one suggested by dhvani2511 gave me this...
    (The cursur is over "Item 1" it is not blue when a cursur is not over it.)
    I would like the image to "be" the button, not just "in" it,if that makes sense.
    I have slightly tried the one suggested by .V1 but being that I am new to dreamweaver, code, etc. I am not sure where to copy/paste the code that you gave me.
    Does anyone have anymore information?
    Thanks,
    Musicman1994

  • Background image to fill the whole screen

    Hi everybody
    Please assist,
    1st question : I want to add the background image that fit the whole screen. I have tried to put image background however it leaves white spaces on the edges and another thing is that after adding the background image when I add content in the tables the background image start to repeat.
    This is the website example I want to achieve : www.inesjaksic.com , www.grupa-desperado.com
    www.street-heroes.com
    2nd question : How to add the scroll bar on the text content, so when you scroll only the text moves.
    Website example : http://www.kls.com/page.php?p=about/biography/index
    Thank you in advance for your help.
    Kind regards
    Vusi
     

    #1 Background images are static.  They don't resize to fill the browser viewport without a lot of additional tricks which may or may not work in all browsers.   Moreover images that resize quickly become distorted.   For best all around results, build your page to a fixed-width target audience (990px is usually fine for most users).  Use a seamless background tile or gradient slice and repeat it vertically (repeat-y), horizontally (repeat-x) or both ways (repeat).
    #2 Use CSS overflow and height property.
    #divName {
    height: 400px;
    overflow: scroll;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Background images are not rendering while they are in all other browsers.

    Firefox is having problems with certain .jpg images that I have uploaded to a hosting service.
    (Ex: http://img838.imageshack.us/img838/3991/hbbgardenorangepop3.jpg)
    When you set this image as your web page's background image, the image will not be rendered. However, if you go directly to the URL, the image will be rendered (except in the Beta release, where the image won't even render when you go to the URL directly).
    However, if you go to ANY other browser, the image is rendered correctly (both when you go directly to the URL and when you use the image as your background).
    == This happened ==
    Every time Firefox opened
    == Today ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4

    I assume that you want to add that image as a background on web pages.
    How are you adding that background image?
    Are you using code in userContent.css ?
    If that is the case then please post the code, otherwise provide the steps so we can check what goes wrong.

  • How do you make a rectangle resize with background image?

    I'm trying to add links (transparent rectangles) to a background image that is set with "scale to fit". However when it scales in needs to scale with my links. Can I have the rectangles scale with the background image? If not is there a better way of doing this?

    As I understand. correctly.  You want the rectangles that you have added over background image, (to which links are added) to be responsive in layout within the project, Am I correct ? If yes ! Muse does not implement "Responsive Layout" as defined by a hand coder. For more details refer to : Can you create responsive sites with Adobe Muse?

  • Background image not showing up in generated FlashHelp

    I have added a background image (.jpeg) to my help
    project´s style sheet. The image shows up in the style
    sheet´s preview, the WYSIWYG window and even ctrl+W previewed
    help; but when I generate the entire project, it is nowhere to be
    found. Any ideas? Any help would be much appreciated.
    Thanks!

    Hi uds
    You may wish to try adding the image to your list of Baggage
    Files. Just right-click the Baggage Files folder in your Project
    Explorer pane and add the image.
    Give that a go and see if it helps... Rick

  • Template - background image missing

    Hi I'm sorry to be back but I have another problem that I don't seem to be able to solve.  I have looked at similar posts online,  but don't seem to have found the answer. 
    I have created a template from Dreamweavers blank templates.  I have made ONLY TWO CHANGES to the blank template.  I've added a background image, and removed the background colour from the .body element. I'm hoping this will help isolate my mistake.
    When I create a new page from this template the background image does not display.  I've noticed that the image path is changed in the child page - whereas the template displays the relative path, the full path is given in the child.  I don't know if this is part of the problem?
    The problem occurs both when I preview the site through a browser, as well as online. 
    I know I should be using templates for site-building, so need to know what I'm doing wrong here.  Many thanks, and please remember that I'm a novice so put it very simply so that I can grasp what your saying! 
    http://www.gillwykes.com/development/frank_test/testpage2.html
    Thanks!

    I just tried a different approach.  Created a new site, through Site Manager.  Created an new HTML paged and did Save as Template.  I then added an image ( which is stored in the images folder in the site) as a background through Page Properties.  I saved and closed the template, and did File, New Page from Template.  The image did not display, and the path to the image was changed.  Here is the code.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <style type="text/css">
    body {
              background-image: url(../images/Copy%20of%20IMG_2481.jpg);
    </style>
    </head>
    <body>
    </body>
    </html>
    and
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/test1.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    <style type="text/css">
    body {
              background-image: url(file:///C|/Documents and Settings/admin/My Documents/1DREAMWEAVER/1_IN_PROGRESS/template_test/images/Copy%20of%20IMG_2481.jpg);
    </style>
    </head>
    <body>
    </body>
    <!-- InstanceEnd --></html>
    I'm obviouly missing something along the line.  It can't be a glitch in CS5.5 because it would be known by now!  But I've tried so many different files and methods now I'm totally confused.
    Next step, seeing if I can edit it in Notepad, and how that afffects things, and also digging out a previous version of Dreamweaver and see what happens there.  Will let you know!

  • 7941/61g background image question

    I have added a background image to our 7941/61g ip phones. The image looks good, but the button appearance divider lines are going accross the screen in front of the image. Is there any way to set up the display to remove the button separator lines while keeping the line labels?
    I had looked into using the idle url, but found that I had to use an external web server for this. Besides, I am not sure if the idle image would be over top of the button labels. If anyone knows if this is the case I would appreciate hearing about it.
    Thanks,
    Mark

    The issue is not that I can't get the custom background image on the phone. I have a custom background on the phone, but the line appearance deviders (The lines above and below each line label) extend completely across the display over top of the background image. For example, I have 6 buttons comfigured on a 7961G phone which causes 7 lines to cross all the way across the phone display. If I have 3 lines configured only 4 lines extend across the display.
    I am asking if there is any way to remove the lines deviding the phone-line labels that are going across the display over top of the custom background image.
    I was at a store the other day and saw that their 7961 phone had a background image and the line labels only had boxes around them. The line label deviders did not extend across the phone any farther than the line label text. This is what I would like to configure. I'm not sure if the phone was useing Callmanger or a SIP server though.

  • How do they get background image to span browser width?

    At http://www.archerschoicemedia.com, they have a background image at the top that spans the entire browser width. How is that achieved? What if image isn't as wide as screen resolution, won't it just repeat?
    All help with adding a background image that does this - spans the entire browser width - is what I'm after.
    Thanks!

    What if image isn't as wide as screen resolution, won't it just repeat?
    No.
    The CSS reads
    body {
    font: 100% Verdana, Arial, Helvetica, sans-serif;
            background:url(../i/backgroundvid.jpg);
            background-position:center top;
            background-repeat:no-repeat;
            background-color:#000000;   
    margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    overflow-x: hidden;
    overflow-y: auto;
    So, the CSS is set to horizontally center the background image and not repeat it.
    Plus, on screens wider than 1689px wide, the background color of black (#000000) shows through at the edges creating the impression that the background is endless.

  • Adding .flv or .swf in dreamweaver on top of background image

    Hi,
    I added an image  background 1900 x 1200 in dreamweaver, which will serve as my  background image for my web site. I would like to incorporate my .flv or  .swf on top of my background image. Although, when doing so, the .flv  or .swf gets placed under the background image and not on top. How do I  place the .flv or .swf file on top of my background image in Dreamweaver  CS5.
    Thanks

    Hi
    This sounds as though you are not actually using a  background-image but just placing an image on the page. To get any help  people will have to see your page and the code, can you provide a link  to a live page?
    BTW: Your background-image size is way to big for most users monitors, just thought you should know.
    PZ

  • Adding background image to navigation tabs

    I am adding a backgraound image to a navigation tab and so far have found the only way to do this is by modifying the HTMLTableCell class and adding a method that sets the background image. The closest existing method is setBgColor - which doesn't work.
    I'm sure there has to be a better way to do this?
    Thanks

    My favorite technique is to use CSS. Try this in a stylesheet:
    BODY { background-image: url(marble.gif);           background-color: #cccccc; } P { background-image: none;           background-color: #cccccc; }
    For more information visit http://css.nu/.
    You can apply that style to a <DIV> you use to bound your header, for instance.
    David Phipps
    Plumtree Software

Maybe you are looking for

  • How can I add multiple contacts to a text message on a droid bionic

    How can I add multiple contacts to a text message on a droid bionic?

  • Problem in a simple webapplication

    Hi I am trying to create a basic web application where i have following Myapp/1.jsp: A form which takes the user input WEB-INF/classes/MyServlet.java: Creates database connection, fetches data, populates a bean and fowards the request to another jsp.

  • Error while doing confirmation as no data for lot found

    Dear QM Gurus, We are testing for activating notification type for inspection type. We have assigned notification type to inspection type '04'. Thereafter we have removed and made settings as previous. But now while confirmation of order, it is throw

  • IMovie Jingle track "Newborn". Who owns the rights?

    The band Lazylectric has a song called Lose You in which the background music sounds exactly like the iMovie Jingle track Newborn. So, which came first? Did Apple buy the background music from Lazylectric, or did Lazylectric use that Jingle track as

  • Unrelated Audio on new Ingested files using Prelude CC

    Why would my new Ingested files use audio from previous Ingested files that are completely unrelated when I open them in Premiere Pro CC to began a new Project? I can not hear any audio that's on the Ingested file, just a different files audio from a