You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > MozBackgroundInlinePolicy
MozBackgroundInlinePolicy style property
Specifies or retrieves how the backgroundImage of an inline element is determined when the contents of the inline element wrap onto multiple lines.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: -moz-background-inline-policy |
Possible values:
The type of this property is string.
One of the following values:
The backgroundImage is shown behind the entire element as a whole. | |||||||
The backgroundImage wraps around on to each line as if the text had no line breaks. | |||||||
The backgroundImage is shown behind each box as a whole in the current element. | |||||||
Takes the value of this property from the computed style of the parent element. |
Default: continuous.
Example HTML code 1:
This example illustrates the use of the -moz-background-inline-policy property:
|
||||
<head> <style> .example { background: url("rainbow.gif"); -moz-background-inline-policy: continuous; border: solid 2px black; } </style> </head> <body> <span class="example"> <strong>This element should have a rainbow background which follows it around, however much it wraps, so that it starts on red on the first line and gradually goes through yellow, orange, green, blue, indigo, and violet. If the inline is longer than the background, the background should start over. If each line starts again at red, then the test has failed.</strong> Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. </span> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the MozBackgroundInlinePolicy property in JavaScript:
|
||||
<head> <style> #mySpan { background: url("rainbow.gif"); -moz-background-inline-policy: continuous; border: solid 2px black; } </style> <script type="text/javascript"> function ChangeBgInlinePol (selectTag) { // Returns the index of the selected option var whichSelected = selectTag.selectedIndex; // Returns the text of the selected option var bgLinePolType = selectTag.options[whichSelected].text; var span = document.getElementById ("mySpan"); if ('MozBackgroundInlinePolicy' in span.style) { span.style.MozBackgroundInlinePolicy = bgLinePolType; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <span id="mySpan"> <strong>This element should have a rainbow background which follows it around, however much it wraps, so that it starts on red on the first line and gradually goes through yellow, orange, green, blue, indigo, and violet. If the inline is longer than the background, the background should start over. If each line starts again at red, then the test has failed. </strong> </span> <br /> <select onchange="ChangeBgInlinePol (this);" size="3"> <option />bounding-box <option selected="selected" />continuous <option />each-box </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.style
HTML elements:
a, abbr, acronym, address, applet, b, bdo, big, blink, blockquote, body, button, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, embed, fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:image, input:password, input:radio, input:reset, input:submit, input:text, ins, isindex, kbd, label, legend, li, marquee, menu, object, ol, optgroup, option, p, pre, s, samp, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tt, u, ul, var
Related pages:
MozBackgroundClip
MozBackgroundOrigin
background
backgroundAttachment
backgroundColor
backgroundImage
backgroundPosition
backgroundRepeat
MozBackgroundOrigin
background
backgroundAttachment
backgroundColor
backgroundImage
backgroundPosition
backgroundRepeat
External links:
User Contributed Comments