Posted by Rob Cornish
October 3, 2008
Today at work we ran into a problem with Firefox using a background on the body.
The setup was a background on the body tag to be centered with the browser window to fit behind a centered div.
Using a min-width on the body alone done nothing. IE6 and 7 with width:1024px; on the div stopped the background from moving but not in Firefox.
To fix this in Firefox we had to add the html element into the css tag.
html, body { min-width:1024px; background:url(image.jpg) no-repeat center 0; }
div { width:1024px; margin:0 auto; }
Note: You don't need to include the background here, this can just go normally on the body tag.
Tags: background, body, center, css, div, firefox, html, ie6 | Comments (0)
Posted by Rob Cornish
March 24, 2008
I've just hit a browser difference that stopped me for a while!
My problem:
Text links outside a scolling div to jump the scroll view to the desired location within the scrolling div.
The scrolling div has the css overflow:auto; with a set height to enable scrolling.
Using normal anchor links and names worked for firefox but not IE6 + IE7, after researching on the net I came across a javascript equivalent.
document.getElementById('elmID').scrollIntoView(true);
This is how I used the code, by adding this line of code into the anchor tag:
<a href="javascript:document.getElementById('elmID').scrollIntoView(true);">
Using this javascript and adding ID's to the areas I needed for scroll view worked a treat!
Tags: css, div, firefox, ie6, ie7, javascript, overflow, scrolling | Comments (3)