Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Background Problem (not aligned correctly)

    I'm using a background to create a border effect around my webpage. Problem is, the background border had to align exactly with an image on my website. I think matters are complicated because my website is centered. Here's the page in question:
    http://www.gamexplain.com/test2.shtml

    Here's the problem: Depending on the user's window size, the background may look just fine, or be off by a pixel,l thus ruining the effect. You'll notice the problem in the top right and top left corners of the bordered image just underneath the top navigation bar. You may have to resize your window horizontally to see the problem.

    Am I doing something wrong, or is there another way around this problem?

    Edit: Here's a a screenshot I took showing the exact problem:
    http://www.gamexplain.com/background.jpg
    Last edited by duderdude2; 03-21-2005 at 08:41 AM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    i see your back to absolute positioning for everything, that is part of your problem, i say restart and try to make your page without absolute positioning, that causes a problem in the long run which you will see you have run into, when u use absolute positioning, i dunno if you know but the element that has it will NEVER move from its spot

  • #3
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_
    i see your back to absolute positioning for everything, that is part of your problem, i say restart and try to make your page without absolute positioning, that causes a problem in the long run which you will see you have run into, when u use absolute positioning, i dunno if you know but the element that has it will NEVER move from its spot
    Thanks, but that's what I want. I don't want those images to move from their spots.

  • #4
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,788
    Thanks
    8
    Thanked 131 Times in 129 Posts
    <DIV style="position: absolute; top:51px; left:1px; width:704px; height:57px"><img src="/images-background/backgroundtop.jpg"></DIV>

    is that your problem?

    I see it looks fine in IE6 this way.

    try this:

    replace:
    <DIV style="position: absolute; top:51px; left:1px; width:704px; height:57px"><img src="/images-background/backgroundtop.jpg"></DIV>

    with:

    <DIV id="bgtop"></div>

    an in your css put this:

    #bgtop {
    position: absolute;
    top:51px;
    left:1px;
    width:704px;
    height:57px;
    background:url(/images-background/backgroundtop.jpg) no-repeat;
    }
    #bgtop[id] {
    left:0;
    }

  • #5
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I did that, but I still have the problem. I also tried changing the "left: 1px" to a 0, but it has the same problem. Depending on the site of the user's window, the background may or may not align, always by just 1 pixel.

    Thanks for the help.


  •  

    Posting Permissions

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