bhazzard Posted November 5, 2005 Share Posted November 5, 2005 okay so I have a huge gripe with the specs for the "background-attachment:" values available to us in css. Scroll means that the background image will scroll within the containing element.Fixed is a little more controversial. in IE, Fixed means that the background image is fixed to the containing element; In Mozilla it means it is fixed to the viewport. According to the specs, IE is in the wrong, but according to useful applications, I think IE was on to something.Obviously there are applications for fixed the way it stands... but there are millions of applications for fixed the way IE treats it, perhaps more applications than there are for the proper treatment of the value.So why havent we caught on to this and created a new value that allows us to fix a background to the containing element? That way developers would have so much more power in their background image arsenal.I say this needs to happen quickly!!!! Link to comment Share on other sites More sharing options...
Nago Posted November 6, 2005 Share Posted November 6, 2005 There are a lot of things that need to occur with HTML and CSS. Until then, take up drinking. It'll be healthier. Link to comment Share on other sites More sharing options...
bhazzard Posted November 8, 2005 Author Share Posted November 8, 2005 There are a lot of things that need to occur with HTML and CSS. Until then, take up drinking. It'll be healthier.<{POST_SNAPBACK}> Sadly, you are probably right. Until these changes happen though, we all have to rely on rediculous hacks and workarounds that make our code look rediculous. Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted August 25, 2008 Share Posted August 25, 2008 Is there a way to make the background image inherit or something? Link to comment Share on other sites More sharing options...
rzea Posted August 25, 2008 Share Posted August 25, 2008 I ran a small test and created a DIV with a background image, not fixed at first. This is the code I used:HTML: <div id="fixed-bg"> <p>fixed-bg</p> <p>fixed-bg</p> <p>fixed-bg</p> <p>fixed-bg</p> <p>fixed-bg</p> <p>fixed-bg</p> <p>fixed-bg</p> <p>fixed-bg</p> </div> CSS: #fixed-bg { width:200px; height:200px; background:url(background.jpg); overflow:auto;} Surprise, surprise, Firefox 2.x FIXES the background to the container even when the background: declaration does not have the fixed property in it. But IE6/7 handle the declaration properly: when fixed is applied, it fixes the background, when it's not applied, it scrolls properly with the content.It's... supposed... to... work in... Firefox! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now