Problems with repeating background pictures on IE8
k, I used jQuery to dynamically frame webpage content inside some art (which has pictures defined for the corners, the bottom, the left, the right as well as some repeating background picture inside the frame).
Additionally, there is repeating background image for outside the frame.
I renders everything without problem on my desktop for the following browsers: Opera, Google Chrome, Safari, Firefox and IE7.
Recently, I ran it on my laptop and it was rendered without problem for the above browsers, except for IE8 where the following problems were encountered:
1) Despite the fact that the background images for the frame's content are 50x50 pixels and that the frame's content is 500x500 pixels, there seems to be enough slack space at the right and bottom of the frame's content for the background picture to partially repeat itself both at the right and bottom (undesirable result, I was hoping that if the dimensions of the frame's content are always an integer multiple of 50 pixels, I wouldn't have clipped repeating pictures at the fringes).
2) Some repeated background pictures both inside and outside the frame are just messed up (some are out of alignment, some that are not at the fringes of their container are clipped in weird places and IE seems to unsuccessfully try to fix their appearance when I click on the background).
After some frustration, I decided to remove all the jQuery logic and instead copy-paste a static version of the DOM (as shown in IE's development tools) that appared once jQuery had done its work to see if the problem would go away. It didn't.
Here is the html and the accompanying csses (modified a bit to remove sensitive content like paths and embedded python code):
Here's the main reasons why I used absolute positioning:
While the above html looks messy, the code in my page to render the above has the following:
2) Centering both horizontally and vertically inside the parent is a nightmare
I saw a bunch of hacks for it. I tried some, but it didn't work for all browsers. Ultimately, I'm not interested in entering the realm of hack land.
However, I'm knowledgeable enough in mathematics to implement the relatively simple task of centering an element within its parent if I know their position and dimensions.
3) I need to implement a chess-like grid with moving pieces so I'll need to use absolute positioning for some things.
Now, if the grid is not inside an absolutely positioned parent, you can't position the children relative to the top-left of their parent. This means that you are stuck positioning them relative to the top-left of the document and since the browser helpfully returns the value of "auto" for the top-left of their parent, good luck placing the moving pieces at the right position inside the parent.
Overall, it seems to be that if I byte the bullet and get over the initial learning curve of using absolute positioning (which from a general perspective I'm comfortable with because of my experience in graphics), my life will be simpler afterwards.
Sure all pro gamer are most welcome... if you can reach out to them it would be great!! Thanks a lot
Ya it will be great if they both get active on this forum...
and share their exp. with gaming...
I applaud your enthusiasm, but truth be told, I'm a lone entrepreneur with a modicum of experience in the gaming industry and as such don't really have any pull within the gaming development community atm.
I guess you could say I'm a gaming professional in the loosest sense of the term, I certainly like to think that I am.
I'm confused. As Abdura said, if you use float instead of absolute positioning, then you can still, and more effectively control the placements of divs by way of the use of margins.
The main thing is: I'll need to place and fluidly move some elements relative to the top-left corner of their parent once the page is loaded.
Now, if you know how to place (and fluidly move) a children at a precise pixel value offset relative to the top-left of an "in flow" parent once the page loaded, please enlighten me, I'm all ears.
Otherwise, it seems to me like absolutely positioned elements is the way to go for things that will contain children that need translation movement animation, despite some of the pitfalls with text resizing and the like.