Is “scroll” a valid value for the background CSS property in Internet Explorer?
So, does Internet Explorer ignore the following rule because of the presence of “scroll”?
background: url('/images/site.gif') scroll 0;
This question was asked because there was an argument between two other users over the validity of the scroll attribute for Internet Explorer. Since I myself didn’t know if it was a valid attribute, I decided to post the question, and told the 2 of them to just follow the post. But, this is Stack Overflow, so of course my question is stupid / irrelavant / down voted. That begs the question, why is an answer to a stupid question up-voted?
It is a valid property (See MSDN, MDN). But since you don’t believe the documentation, the only way to convince you is to show a screenshot.
scrollis a valid property ofbackground-attachment(which is included in the shorthand forbackground). In fact, it’s the default value.To proof this, we read the value of
document.body.currentStyle.backgroundAttachment. It’s even supported in IE6!In your initial comment, you said “that is background-attachment: Not background.”. So, taken that you still do not believe the documentation, I’ll show yet another proof:
fixedis not a valid value for thebackgroundshorthand.background-attachmentis not included in the shorthand, because we know from the top part of this answer that"fixed"is a valid value ofbackground-attachment.body {background: url('/favicon.ico') fixed 0;}, thenalert(document.body.currentStyle.backgroundAttachment);should display “scroll”, because it is the default value ofbackground-attachmentand we assumed thatbackground-attachmentis not supported by the background short-hand.background.