I’m rewriting a themes code (theme runs on thousands of sites) for a new release and have it working perfectly in WordPress 3.0.4 and below, wise to test on the beta release and hit a snag.
The padding was breaking my themes layout, wasn’t able to get it to work with WordPress 3.1 and earlier version of WordPress. One div was thrown off.
I tested Esmi’s code with my theme and it looks like it resolves the issue.
I have a div positioned with this CSS
.navbar {
width: 990px;
position: absolute;
top: 115px;
}
this is not unusual theme code.
With the current WordPress 3.1 beta code it’s obviously not taking the 28px padding into account, so when the admin bar is present it’s 28px to high. With Esmi’s CSS code (as a replacement for the Admin bars CSS) it’s where it should be.
I didn’t want to force theme users to turn the admin menu off by default.
I’ve fixed the issue by adding a wrapper div to the whole theme and giving it position:relative; which means the absolute element that was being positioned absolute to the body is now positioned absolute to the wrapper div which is padded down in WordPress 3.1 and not in WordPress 3.0 and below. Really shouldn’t have to add this fix when a simple bit of CSS on the admin bar would have avoided it for my theme and presumably lots like it.
David