Name
backgroundPosition — NN n/a IE 4 DOM n/a
Synopsis
Read/Write
Top and left location of the background image relative to the element’s content region (plus padding). This property is not properly connected in Internet Explorer 4 for the Macintosh.
Example
document.all.div3.style.backgroundPosition = "20 50"
Value
You should be able to specify one or two percentages, which are the
percentages of the block-level element’s box width and height
(respectively) at which point the image (or repeated images) begins.
Setting percentage values, however, does not always work in IE 4 for
Windows (and it doesn’t work at all on the Mac), even though
they are returned as the default value units. You are safest with
pixel values (as space-delimited values inside one string). None of
the allowed constants except top and
left are recognized.
Default
0%
0%
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access