SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2001
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS background image problem

    I can't get my CSS background image to appear onthe web page when I upload:

    Here's what I did:

    Created nav bar image in graphics software (in my case FW)
    Created table on site with the same dimensions as the image
    Created new CSS style using the image as the background and inserted into the table.

    Should now have nav bar on the site (set as a bkgd) in which you can now create your CSS nav links, or image rollovers.

    Problems:
    Nav bar appears in preview mode (DW) but not when I upload CSS sheet, image and web page.

    Here's the page with blank navbar

    http://www.ihost-websites.com/charles/index8.shtml

    With nav bar (how I want it):

    http://www.ihost-websites.com/charles/index7.shtml

    Code I am using in style sheet:

    .menubg { background-image: url(images/menubg.gif); background-repeat: no-repeat; background-position: 140px 420px}

    Where am I going wrong?

    Thanks,
    Herman
    PS I will be using CSS navbar links once bkgd image is positioned correctly.
    Herman Drost
    http://www.isitebuild.com
    Affordable Web Site Design
    and Web Site Hosting

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,296
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    You are placing the bg image outside its container. You need to place it at left top :
    e.g.
    Code:
     background-position: left top;
    Not at background-position: 140px 420px which will place the image at 140px from the left and 420px from the top of its container.

    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •