+ Reply to Thread
Results 1 to 8 of 8

Thread: Positioning/Aligning Banner with Background Image

  1. #1
    kyuusei's Avatar
    kyuusei is offline x10Hosting Member kyuusei is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    49

    Positioning/Aligning Banner with Background Image

    Hey guys I need some help with my website: http://www.fox1photography.co.cc/test2.html

    Now depending on what browser you use, the banner may or may not line up with the background image like in the screenshot below:



    I've tried to use various iterations of CSS tweaks but this still happens. My last resort is to use an integrated background image with banner and use a fixed height, but I'd rather not. Any ideas?



  2. #2
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: Positioning/Aligning Banner with Background Image

    what browser are our using? I see no problem under firefox 3.5.2

    Anyways, try adding the following to your header css.
    Code:
    position: relative;
    left: -1px;
    BTW, instead of having the header outside the main div, enclose everything inside a div that you position in the center.
    Last edited by xav0989; 10-10-2009 at 01:15 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  3. #3
    kyuusei's Avatar
    kyuusei is offline x10Hosting Member kyuusei is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    49

    Re: Positioning/Aligning Banner with Background Image

    Everything looks fine in Firefox, but the problem shows up when using IE to render the page. I haven't gotten anyone to test it with Google Chrome or Opera.



  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Positioning/Aligning Banner with Background Image

    Add to style:

    body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #888888;
    background-color: #E1E1E1;
    background-repeat:repeat-y;
    background-position:50% 0%;
    background-image:url('http://www.fox1photography.co.cc/graphics/bodybg1.png');
    margin: 0px;
    border: 0px;


    }
    Nothing is always absolutely so.

  5. #5
    kyuusei's Avatar
    kyuusei is offline x10Hosting Member kyuusei is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    49

    Re: Positioning/Aligning Banner with Background Image

    Quote Originally Posted by xav0989 View Post
    what browser are our using? I see no problem under firefox 3.5.2

    Anyways, try adding the following to your header css.
    Code:
    position: relative;
    left: -1px;
    BTW, instead of having the header outside the main div, enclose everything inside a div that you position in the center.
    What you posted didn't exactly work because it just shifts it over to the left, which fixes it in IE8, but breaks it in Firefox 3.5

    But switching the banner over to position: relative; and moving it up a few pix did it at least as far as I can tell.

    Does it look right on your end? Sing out what browser you're using if you can please. So far it looks right in FF 3.5 and IE8. Thanks for the help guys!

    EDIT:
    Its still broken on Firefox 3.0
    Arrrgh is there anything wrong with my coding or can this be just chalked up to browser bugs?
    Last edited by kyuusei; 10-10-2009 at 02:03 PM.



  6. #6
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: Positioning/Aligning Banner with Background Image

    My solution would have made it work seamlessly if the image would have been inside the centered div. However, it does not work as good when the image is outside.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  7. #7
    kyuusei's Avatar
    kyuusei is offline x10Hosting Member kyuusei is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    49

    Re: Positioning/Aligning Banner with Background Image

    Quote Originally Posted by xav0989 View Post
    My solution would have made it work seamlessly if the image would have been inside the centered div. However, it does not work as good when the image is outside.
    No, I tried it with it inside the div. It moves it left a pixel alright, and that fixes it when a browser renders it off to the right. But when opened in a browser that renders it properly, its now off to the left.

    So in Firefox 3.5 and IE8 it goes like this:

    |Banner|
    | BG |
    | BG |

    In Firefox 3.0 it renders it incorrectly like this:

    |Banner|
    | BG |
    | BG |

    With your earlier fix it just makes it go like this in Firefox 3.5 and IE8:

    |Banner|
    | BG |
    | BG |

    and like this in Firefox 3.0

    |Banner|
    | BG |
    | BG |



  8. #8
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Positioning/Aligning Banner with Background Image

    Did you try my fix? It seemed to work on IE7.
    Nothing is always absolutely so.

+ Reply to Thread

Similar Threads

  1. Stretching a background image?
    By WhiteOut in forum Programming Help
    Replies: 3
    Last Post: 03-28-2009, 11:37 PM
  2. Replies: 2
    Last Post: 03-12-2009, 12:54 AM
  3. Fixed background image
    By stalkio in forum Programming Help
    Replies: 3
    Last Post: 07-26-2008, 10:41 AM
  4. errors while attaching
    By mattspec in forum Feedback and Suggestions
    Replies: 0
    Last Post: 12-19-2005, 01:50 PM
  5. November Desktop
    By n4tec in forum Off Topic
    Replies: 12
    Last Post: 11-08-2005, 07:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers