SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy BG Image placement using CSS

    I am having some difficulty with an image that I want to position using CSS.

    I need the image to sit underneath a table structure, such that it straddles between a TD divider (hence it couldn't be applied to a table element).

    I got it to work fine in IE5, but since looking at it in IE5.5 and also IE6, it just does not appear.

    In addition it does not work in Opera 5 or Netscape 6, so something is wrong.

    Here is the syntax used:

    .homePageBGImage {
    width:280px;
    height:347px;
    background:url("/category/_bgimages/woman-carrying-shopping.jpg") 0px 15px no-repeat;
    }

    So, in IE5, it is positioned exactly where I want it. The image is fine.

    Please note: I am running this over a server, so there should be no issues regarding the referencing of the file from the root directory.

    I am really desperate for any help people can provide on this ...

    Many thanks

    Ian

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could be wrong, but it is possible that the CSS is being rejected because of this line:

    Code:
    background:url("/category/_bgimages/woman-carrying-shopping.jpg") 0px 15px no-repeat;
    I always thought the correct way to reference the repeat properties was by using background-repeat:.

    Give it a go!?

    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The background property is shorthand for all the background-* properties, including background-repeat, so I wouldn't think that's the problem.

    From the looks of it, it should work, I think. Why not give us the entire code or a link to it (including the HTML you're using) -- there may be some sort of conflict?

  4. #4
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not quite that easy ...

    I can't provide you with the page as such because it is on an internal development server that you cannot see, and I am unable to load the development files on my own personal webspace because of FTP firewalls.

    If you drop me a line personally,. I will email you what I have, as far as the CSS is concerned. It's a little complex, in that I use the following approach:

    * Base Style Sheet
    * Javascript browser detect loads a
    * browser-specific .js file with tweaks for certain browsers
    * separate css file for these decorative BG images, loaded only for certain browsers.

    I could send you the lot sequentially?

    If you can help, e-mail me. That'd be grand

    My e-mail (in an encoded form!]

    Ian

  5. #5
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OK, forget it folks ...

    I have discovered the problem - it was a CSS comment /* like this */ among many which was not correctly opened (missed the first /*)

    That's all it was ...

    Strange that it worked at all in IE5 though.

    Still causes Netscape 4 to die horribly but where's the surprise there?


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
  •