You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > MozOutline

MozOutline style property

Browser support:
Sets or retrieves the outline of the element.
Deprecated and the support for it has been removed in Firefox 3.6. Use the cross-browser outline property instead.


You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: -moz-outline

Possible values:

The type of this property is string.
 One of the following values: 
 Any of the following values (use the space character to separate them, each value can be used only once): 

Description of values:

Sets or retrieves the color of the outline.
Sets or retrieves the style of the left, right, top, and bottom borders of the object.
Sets or retrieves the width of the outline.
Takes the value of this property from the computed style of the parent element.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the -moz-outline property:
        .example {
            -moz-outline: 5px solid blue;
            border: 5px solid black;
    <div class="example">Outline and border</div>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the MozOutline property in JavaScript:
    <script type="text/javascript">
        function SetMozOutline () {
            var div = document.getElementById ("myDiv");
            var input = document.getElementById ("myInput");

            if ('MozOutline' in {
       = input.value;
            } else {
                alert ("Your browser doesn't support this example!");
    <div id="myDiv">Outline: 1px solid blue</div>

    <br /><br /><br />

    <input id="myInput" type="text" value="4px dotted blue" />
    <button onclick="SetMozOutline ();">Set MozOutline!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content