I used a script that dynamically centers my content that @joshuanhibbert suggested however, I did something that made it stop working and I'm completely lost. See both links
Moving the script to the bottom of the document (just before the closing body tag) should fix the issue. From my limited understanding, it is running the script before the image element has been drawn, and that is what is causing the issue (which is why the margin top and left values are 0, as the image has no height or width until it has been drawn).
EDIT: The other thing that should fix it would be to wrap the jQuery in the following:
$(document).ready( function() {
});
This would stop the code from running until the page is loaded, but I believe placing scripts at the bottom of the document is best for page load times.
@ChristopherBurton How about if you use a slightly older version of jQuery?
Whatever it is, it's very strange. I'm not having any issues on my end, but can see that your version isn't working. Mind using my code again so that I can see if the console shows any errors?
@joshuanhibbert So I think the issue is on my end because I'm using dual monitors. When I drag my browser window into the the other monitor, it starts to center. But the height is still slightly off.
I'm getting the problem on my end too, both on my work and personal machines. The jQuery still seems to be @Hompimpa's code, or did you change it back?
Link 1
Link 2
jQuery
EDIT: The other thing that should fix it would be to wrap the jQuery in the following:
This would stop the code from running until the page is loaded, but I believe placing scripts at the bottom of the document is best for page load times.
Edit: I just missed the quotes
Whatever it is, it's very strange. I'm not having any issues on my end, but can see that your version isn't working. Mind using my code again so that I can see if the console shows any errors?
$(document).ready()and$(window).load(): http://4loc.wordpress.com/2009/04/28/documentready-vs-windowload/