Safari and Web Kit implement a large subset of the CSS 2.1 Specification defined by the World Wide Web Consortium (W3C). This reference describes the supported properties and provides Safari availability information. If a property is not listed here, it is not implemented by Safari and Web Kit.
Box Model
Visual Formatting Model
Visual Effects
Generated Content, Automatic Numbering, and Lists
Paged Media
Colors and Backgrounds
Fonts
Text
Tables
User Interface
Aural
Unsupported Properties
Defines a variety of border properties for an element within one declaration.
border: value1 value2 ... valueN |
Safari 1.0 and later.
CSS 2.1
Defines a variety of properties for an element's bottom border within one declaration.
border-bottom: value1 value2 ... valueN |
Safari 1.0 and later.
CSS 2.1
Defines the color of the bottom border of an element.
border-bottom-color: value |
activeborder, activecaption, appworkspace, aqua, background, black, blue, buttonface, buttonhighlight, buttonshadow, buttontext, captiontext, fuchsia, gray, graytext, green, grey, highlight, highlighttext, inactiveborder, inactivecaption, inactivecaptiontext, infobackground, infotext, lime, maroon, match, menu, menutext, navy, olive, orange, purple, red, scrollbar, silver, teal, threeddarkshadow, threedface, threedhighlight, threedlightshadow, threedshadow, transparent, -webkit-activelink, -webkit-focus-ring-color, -webkit-link, -webkit-text, white, window, windowframe, windowtext, yellow
Safari 1.0 and later.
CSS 2.1
Defines the style of the bottom border of an element.
border-bottom-style: value |
dashed, dotted, double, groove, hidden, inset, none, outset, ridge, solid
Safari 1.0 and later.
CSS 2.1
Defines the width of the bottom border of an element.
border-bottom-width: value |
Length units
medium, thick, thin
Safari 1.0 and later.
CSS 2.1
Defines the color of an element's border.
border-color: value |
Safari 1.0 and later.
CSS 2.1
Defines a variety of properties for an element's left border within one declaration.
border-left: value1 value2 ... valueN |
Safari 1.0 and later.
CSS 2.1
Defines the color of the left border of an element.
border-left-color: value |
activeborder, activecaption, appworkspace, aqua, background, black, blue, buttonface, buttonhighlight, buttonshadow, buttontext, captiontext, fuchsia, gray, graytext, green, grey, highlight, highlighttext, inactiveborder, inactivecaption, inactivecaptiontext, infobackground, infotext, lime, maroon, match, menu, menutext, navy, olive, orange, purple, red, scrollbar, silver, teal, threeddarkshadow, threedface, threedhighlight, threedlightshadow, threedshadow, transparent, -webkit-activelink, -webkit-focus-ring-color, -webkit-link, -webkit-text, white, window, windowframe, windowtext, yellow
Safari 1.0 and later.
CSS 2.1
Defines the style of the left border of an element.
border-left-style: value |
dashed, dotted, double, groove, hidden, inset, none, outset, ridge, solid
Safari 1.0 and later.
CSS 2.1
Defines the width of the left border of an element.
border-left-width: value |
Length units
medium, thick, thin
Safari 1.0 and later.
CSS 2.1
Defines a variety of properties for an element's right border within one declaration.
border-right: value1 value2 ... valueN |
Safari 1.0 and later.
CSS 2.1
Defines the color of the right border of an element.
border-right-color: value |
activeborder, activecaption, appworkspace, aqua, background, black, blue, buttonface, buttonhighlight, buttonshadow, buttontext, captiontext, fuchsia, gray, graytext, green, grey, highlight, highlighttext, inactiveborder, inactivecaption, inactivecaptiontext, infobackground, infotext, lime, maroon, match, menu, menutext, navy, olive, orange, purple, red, scrollbar, silver, teal, threeddarkshadow, threedface, threedhighlight, threedlightshadow, threedshadow, transparent, -webkit-activelink, -webkit-focus-ring-color, -webkit-link, -webkit-text, white, window, windowframe, windowtext, yellow
Safari 1.0 and later.
CSS 2.1
Defines the style of the right border of an element.
border-right-style: value |
dashed, dotted, double, groove, hidden, inset, none, outset, ridge, solid
Safari 1.0 and later.
CSS 2.1
Defines the width of the right border of an element.
border-right-width: value |
Length units
medium, thick, thin
Safari 1.0 and later.
CSS 2.1
Defines the style for an element's border.
border-style: value |
Safari 1.0 and later.
CSS 2.1
Defines a variety of properties for an element's top border within one declaration.
border-top: value1 value2 ... valueN |
Safari 1.0 and later.
CSS 2.1
Defines the color of the top border of an element.
border-top-color: value |
activeborder, activecaption, appworkspace, aqua, background, black, blue, buttonface, buttonhighlight, buttonshadow, buttontext, captiontext, fuchsia, gray, graytext, green, grey, highlight, highlighttext, inactiveborder, inactivecaption, inactivecaptiontext, infobackground, infotext, lime, maroon, match, menu, menutext, navy, olive, orange, purple, red, scrollbar, silver, teal, threeddarkshadow, threedface, threedhighlight, threedlightshadow, threedshadow, transparent, -webkit-activelink, -webkit-focus-ring-color, -webkit-link, -webkit-text, white, window, windowframe, windowtext, yellow
Safari 1.0 and later.
CSS 2.1
Defines the style of the top border of an element.
border-top-style: value |
dashed, dotted, double, groove, hidden, inset, none, outset, ridge, solid
Safari 1.0 and later.
CSS 2.1
Defines the width of the top border of an element.
border-top-width: value |
Length units
medium, thick, thin
Safari 1.0 and later.
CSS 2.1
Defines the width of of an element.
border-width: value |
Safari 1.0 and later.
CSS 2.1
Defines a variety of properties for an element's outer-element margin within one declaration.
margin: value |
Safari 1.0 and later.
CSS 2.1
Defines the width of the bottom margin of an element.
margin-bottom: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Defines the width of the left margin of an element.
margin-left: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Defines the width of the right margin of an element.
margin-right: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Defines the width of the top margin of an element.
margin-top: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Defines a variety of properties for an element's inner-element padding within one declaration.
padding: value |
Safari 1.0 and later.
CSS 2.1
Defines the width of the bottom padding of an element.
padding-bottom: value |
Length units
Safari 1.0 and later.
CSS 2.1
Defines the width of the left padding of an element.
padding-left: value |
Length units
Safari 1.0 and later.
CSS 2.1
Defines the width of the right padding of an element.
padding-right: value |
Length units
Safari 1.0 and later.
CSS 2.1
Defines the width of the top padding of an element.
padding-top: value |
Length units
Safari 1.0 and later.
CSS 2.1
Allows you to specify that the bottom left corner of a box should be rounded with the specified radius.
-webkit-border-bottom-left-radius: 3px; |
-webkit-border-bottom-left-radius: 3px 5px; |
Length units
This property takes either one or two parameters. If one parameter is specified, it controls both the horizontal and vertical radii of a quarter ellipse. If two parameters are specified, the first parameter normally represents the horizontal radius and the second parameter represents the remaining radius. (Compatibility note: in Internet Explorer, if writing-mode is specified as tb-rl, these parameters are reversed.)
Safari 3.0 and later.
Experimental CSS 3.
Allows you to specify that the bottom right corner of a box should be rounded with the specified radius.
-webkit-border-bottom-right-radius: 3px; |
-webkit-border-bottom-right-radius: 3px 5px; |
Length units
This property takes either one or two parameters. If one parameter is specified, it controls both the horizontal and vertical radii of a quarter ellipse. If two parameters are specified, the first parameter normally represents the horizontal radius and the second parameter represents the remaining radius. (Compatibility note: in Internet Explorer, if writing-mode is specified as tb-rl, these parameters are reversed.)
Safari 3.0 and later.
Experimental CSS 3.
Equivalent to the horizontal portion of the border-spacing property
-webkit-border-horizontal-spacing 3px |
Length units, Non-negative values
Safari 3.0 and later. In Safari 2.0, it is -khtml-border-horizontal-spacing.
Apple extension.
This property allows you to use an image as the border for a box. The specified image is cut into nine pieces according to the length values given. This property applies to any box, including inline elements, but does not apply to table cells if the border-collapse property is set to collapse.
border-image: uri top right bottom left x_repeat y_repeat |
border-image: uri top right bottom left / border x_repeat y_repeat |
border-image: uri top right bottom left / top_border right_border bottom_border left_border x_repeat y_repeat |
none
The first five fields are required. The url field contains the URI for the image. The four inset values that follow represent distances from the top, right, bottom, and left edges of the image. If no unit is specified, they represent actual pixels in the original image (assuming a raster image). If a unit (such as px) is specified, they represent CSS units (which may or may not be the same thing). The values may also be specified as a percentage of the size of the image.
After the required fields, you can optionally include a slash (/) followed by a border width field or fields. You can specify all four border widths individually or specify a single value that applies to all four fields. If these values are not the same size as the inset values, the slices of the original image are scaled to fit.
Finally, you can specify a repeat style in each direction. These values affect how the top, bottom, left, right, and center portions are altered to fit the required dimensions, and can be any of the following: repeat (tiled), stretch, or round (like tiling except that it stretches all nine pieces slightly so that you don't get a partial tile at the end).
Safari 3.0 and later.
Experimental CSS 3.
Allows you to specify that the four corners of a box should be rounded with the specified radius.
-webkit-border-radius: 3px; |
-webkit-border-radius: 3px 6px; |
Length units
This property takes either one or two parameters. If one parameter is specified, it controls both the horizontal and vertical radii of a quarter ellipse. If two parameters are specified, the first parameter normally represents the horizontal radius and the second parameter represents the remaining radius. (Compatibility note: in Internet Explorer, if writing-mode is specified as tb-rl, these parameters are reversed.)
Safari 3.0 and later.
Experimental CSS 3.
Allows you to specify that the top left corner of a box should be rounded with the specified radius.
-webkit-border-top-left-radius: 3px; |
-webkit-border-top-left-radius: 3px 5px; |
Length units
Safari 3.0 and later.
Experimental CSS 3.
Allows you to specify that the top right corner of a box should be rounded with the specified radius.
-webkit-border-top-right-radius: 3px; |
-webkit-border-top-right-radius: 3px 5px; |
Length units
This property takes either one or two parameters. If one parameter is specified, it controls both the horizontal and vertical radii of a quarter ellipse. If two parameters are specified, the first parameter normally represents the horizontal radius and the second parameter represents the remaining radius. (Compatibility note: in Internet Explorer, if writing-mode is specified as tb-rl, these parameters are reversed.)
Safari 3.0 and later.
Experimental CSS 3.
Equivalent to the vertical portion of the border-spacing property
-webkit-border-vertical-spacing 3px |
Length units, Non-negative values
Safari 3.0 and later. In Safari 2.0, it is -khtml-border-vertical-spacing.
Apple extension.
Allows you to specify whether the size of a box is measured based on the content (default) or based on the total size including the borders.
-webkit-box-sizing: model |
border-box, content-box
Safari 3.0 and later.
Experimental CSS 3.
Specifies a drop shadow effect to apply to the border box of an object.
-webkit-box-shadow: hoff voff blur color |
none
This property takes four parameters. The first two are horizontal and vertical offsets, where positive offsets are down and to the right, respectively. The third value is a blur radius. The fourth value is the color of the shadow.
Safari 3.0 and later.
Experimental CSS 3.
Defines the model of an element's bottom margin. This allows you to emulate the behavior of some browsers in quirks mode where table cell margins are collapsed into the borders of vertically adjacent cells.
-webkit-margin-bottom-collapse: collapse |
collapse, discard, separate
Safari 3.0 and later. In Safari 2.0, it is -khtml-margin-bottom-collapse.
Apple extension.
Defines the model of an element's top and bottom margins. This allows you to emulate the behavior of some browsers in quirks mode where table cell margins are collapsed into the borders of vertically adjacent cells.
-webkit-margin-collapse: collapse |
Safari 3.0 and later. In Safari 2.0, it is -khtml-magin-collapse.
Apple extension.
Provides the width of the starting margin. If the writing direction is left-to-right, this value overrides margin-left. If the writing direction is right-to-left, this value overrights margin-right.
-webkit-margin-start: 2em |
Length units
auto
Safari 3.0 and later. In Safari 2.0, it is -khtml-margin-start.
Apple extension.
Defines the model of an element's top margin. This allows you to emulate the behavior of some browsers in quirks mode where table cell margins are collapsed into the borders of vertically adjacent cells.
-webkit-margin-top-collapse: collapse |
collapse, discard, separate
Safari 3.0 and later. In Safari 2.0, it is -khtml-magin-top-collapse.
Apple extension.
Provides the width of the starting padding. If the writing direction is left-to-right, this value overrides padding-left. If the writing direction is right-to-left, this value overrights padding-right.
-webkit-padding-start: distance |
Length units
Safari 3.0 and later. In Safari 2.0, it is -khtml-padding-start.
Apple extension.
Used in absolute or relative positioning of elements, defines the location of the bottom edge of the element.
bottom: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Defines the side(s) of an element on which no floating elements will be permitted to be displayed.
clear: value |
both, left, none, right
Safari 1.0 and later.
CSS 2.1
Sets the direction in which text is rendered.
direction: value |
ltr, rtl
Safari 1.0 and later.
CSS 2.1
Defines how an element is displayed onscreen.
display: value |
block, compact, inline, inline-block, inline-table, list-item, none, run-in, table, table-caption, table-cell, table-column, table-column-group, table-footer-group, table-header-group, table-row, table-row-group, -webkit-box, -webkit-inline-box
Safari 1.0 and later.
CSS 2.1
Indicates whether an element (often a graphic) should be pulled out of the normal text flow and floated towards a particular horizontal position within its enclosing element.
float: value |
center, left, none, right
If float is set to none, the element is displayed inline wherever it appears within the text flow.
If float is set to a positional value, the element is laid out as it normally would be within the flow, then is moved as far as possible towards the specified position. If an element is vertically positioned such that it would run into another element that is part of the same float, it stops at the point of contact. Thus, in effect, this causes these floating elements to stack up at the specified horizontal position.
If the width of a series of stacked floating elements would exceed the width of the enclosing box, further elements wrap to a new row. You can force an element to always wrap to a new row by setting the “clear” property on that element.
Safari 1.0 and later.
CSS 2.1
Defines the height of a structural element. Has no effect for style elements.
height: value |
Length units, Non-negative values
auto, intrinsic, min-intrinsic
Safari 1.0 and later.
CSS 2.1
Used in absolute or relative positioning of elements, defines the location of the left edge of the element.
left: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Defines the vertical inter-line spacing of lines within the text of an element.
line-height: value |
Floating-point numbers, Length units
normal
Safari 1.0 and later.
CSS 2.1
Defines the maximum height of a structural element. Supported by Safari 1.3 and later, except for positioned elements.
max-height: value |
intrinsic, min-intrinsic, none
Safari 1.3 and later. Positioned elements require Safari 2.0.2 and later.
CSS 2.1
Defines the maximum width of a structural element. Supported except for positioned elements.
max-width: value |
intrinsic, min-intrinsic, none
Safari 1.0 and later. Positioned elements require Safari 2.0.2 and later.
CSS 2.1
Defines the minimum height of a structural element. Supported by Safari 1.3 and later, except for positioned elements.
min-height: value |
Length units, Non-negative values
intrinsic, min-intrinsic
Safari 1.3 and later. Positioned elements require Safari 2.0.2 and later.
CSS 2.1
Defines the minimum width of a structural element. Supported except for positioned elements.
min-width: value |
Length units, Non-negative values
intrinsic, min-intrinsic
Safari 1.0 and later. Positioned elements require Safari 2.0.2 and later.
CSS 2.1
Specifies how to blend the offscreen rendering into the current composite rendering.
opacity: value |
Floating-point numbers
Safari 2.0 and later. (In Safari 1.1, it is -khtml-opacity).
CSS 2.1
Specifies how an element is positioned. This affects the behavior of positional properties such as float and left/right/top/bottom.
position: value |
absolute, fixed, relative, static
Safari 1.0 and later.
CSS 2.1
Used in absolute or relative positioning of elements, defines the location of the right edge of the element.
right: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Used in absolute or relative positioning of elements, defines the location of the top edge of the element.
top: value |
Length units
auto
Safari 1.0 and later.
CSS 2.1
Used to define the unicode bidirectional text algorithms. Must be set if you intend to change the direction of inline text.
unicode-bidi: value |
bidi-override, embed, normal
Safari 1.3 and later.
CSS 2.1
Defines the vertical alignment of text in an element.
vertical-align: value |
Length units
baseline, bottom, middle, sub, super, text-bottom, text-top, top, -webkit-baseline-middle
Safari 1.0 and later.
CSS 2.1
Defines the width of a structural element. Has no effect for style elements.
width: value |
Length units, Non-negative values
auto, intrinsic, min-intrinsic
Safari 1.0 and later.
CSS 2.1
Defines the stacking order for elements. An element with a higher z-index value will be displayed on top of one with a lower z-index value.
z-index: value |
auto
Safari 1.0 and later.
CSS 2.1
Defines the clipping region for an element, in which its content will be rendered. Defaults to the entire element size.
clip: value |
auto
Safari 1.0 and later.
CSS 2.1
Defines the behavior of an element when its content overflows its bounds, such as providing scrollbars or hiding the overflowed content.
overflow: visible |
Safari 1.0 and later.
CSS 2.1
Defines the behavior of an element when its content overflows its horizontal bounds, such as providing scrollbars or hiding the overflowed content.
overflow-x: visible |
auto, hidden, overlay, scroll, visible, -webkit-marquee
Safari 3.0 and later.
Stable CSS 3
Defines the behavior of an element when its content overflows its vertical bounds, such as providing scrollbars or hiding the overflowed content.
overflow-y: visible |
auto, hidden, overlay, scroll, visible, -webkit-marquee
Safari 3.0 and later.
Stable CSS 3
Defines whether an element is resizable by the user, and on which axes resizing should be allowed.
resize: horizontal |
auto, both, horizontal, none, vertical
Safari 3.0 and later.
Stable CSS 3
Defines whether or not an element is visible onscreen. Note that elements made invisible using this property still take up space onscreen. Supported except for "collapse".
visibility: value |
collapse, hidden, visible
Safari 1.0 and later. All supported except for collapse.
CSS 2.1
Specifies a whitespace-delimited list of transformations to be applied to an element, such as rotation, scaling, and so on.
-webkit-transform: function [function ...] |
none
The set of transform functions is similar to those allowed by SVG, although there are additional functions to support 3D transformations. If multiple transforms are applied, the transform is generated by performing a matrix concatenation of each transform in the list.
For example, the following div element is rotated 45 degrees clockwise:
<div style="width: 12em; margin-top: 5em; |
-webkit-transform: rotate(45deg)">...</div> |
The supported transforms are:
Function | Description |
|---|---|
| Specifies a 2D transformation in the form of a transformation matrix of six values. |
| Specifies a 2D translation by the vector |
| Specifies a translation by the given amount in the X direction. |
| Specifies a translation by the given amount in the Y direction. |
| Specifies a 2D scale operation by the |
| Specifies a scale operation using the |
| Specifies a scale operation using the |
| Specifies a 2D rotation by the angle specified in the parameter about the origin of the element, as defined by the |
| Specifies a skew transformation along the x-axis by the given angle. |
| Specifies a skew transformation along the y-axis by the given angle. |
| Specifies a perspective projection matrix. This matrix maps a viewing cube onto a pyramid whose base is infinitely far away from the viewer and whose peak represents the viewer's position. The viewable area is the region bounded by the four edges of the viewport (the portion of the browser window used for rendering the webpage between the viewer's position and a point at a distance of infinity from the viewer). The depth, given as the parameter to the function, represents the distance of the z=0 plane from the viewer. Lower values give a more flattened pyramid and therefore a more pronounced perspective effect. The value is given in pixels, so a value of 1000 gives a moderate amount of foreshortening and a value of 200 gives an extreme amount. |
For more information, see the CSS transitions specification at http://webkit.org/specs/CSSVisualEffects/CSSTransforms.html.
Safari 3.1 and later.
Apple extension
Embeds an arbitrary batch of content (such as a movie or a specially-formatted string) to be embedded alongside a CSS property.
content: value |
Safari 1.0 and later.
CSS 2.1
N/A
none
Unsupported.
CSS 2.1
N/A
none
Unsupported.
CSS 2.1
Defines the display style for a list and list elements.
list-style: value |
Safari 1.0 and later.
CSS 2.1
Defines an image to use as the opening symbol of a list element.
list-style-image: value |
none
Safari 1.0 and later.
CSS 2.1
Defines the position of the opening symbol of a list element.
list-style-position: value |
inside, outside
Safari 1.0 and later.
CSS 2.1
Defines the type of the opening symbol of a list element.
list-style-type: value |
armenian, circle, cjk-ideographic, decimal, decimal-leading-zero, disc, georgian, hebrew, hiragana, hiragana-iroha, katakana, katakana-iroha, lower-alpha, lower-greek, lower-latin, lower-roman, none, square, upper-alpha, upper-latin, upper-roman
Safari 1.0 and later.
CSS 2.1
N/A
Unsupported.
CSS 2.1
N/A
Unsupported.
CSS 2.1
N/A
Unsupported.
CSS 2.1
Defines the minimum number of lines in a paragraph that must be left at the bottom of a page (before a page break).
orphans: value |
Integers
Available in Safari 1.3 and later.
CSS 2.1
N/A
Unsupported.
CSS 2.1
Defines the page break behavior following an element's definition.
page-break-after: value |
always, auto, avoid, left, right
Safari 1.2 and later.
CSS 2.1
Defines the page break behavior before an element's definition.
page-break-before: value |
always, auto, avoid, left, right
Safari 1.2 and later.
CSS 2.1
Defines the page break behavior within an element.
page-break-inside: value |
auto, avoid
Safari 1.3 and later.
CSS 2.1
Unsupported.
Unsupported.
CSS 2.1
Defines the minimum number of lines in a paragraph that must be left at the top of a page (after a page break).
widows: value |
Integers
Safari 1.3 and later..
CSS 2.1
Defines a variety of background properties within one declaration.
background: value1 value2 ... valueN |
Safari 1.0 and later.
CSS 2.1
Defines the scrolling or fixed nature of the page background.
background-attachment: value |
Safari 1.0 and later.
CSS 2.1
Defines an element's background color.
background-color: value |
activeborder, activecaption, appworkspace, aqua, background, black, blue, buttonface, buttonhighlight, buttonshadow, buttontext, captiontext, fuchsia, gray, graytext, green, grey, highlight, highlighttext, inactiveborder, inactivecaption, inactivecaptiontext, infobackground, infotext, lime, maroon, match, menu, menutext, navy, olive, orange, purple, red, scrollbar, silver, teal, threeddarkshadow, threedface, threedhighlight, threedlightshadow, threedshadow, transparent, -webkit-activelink, -webkit-focus-ring-color, -webkit-link, -webkit-text, white, window, windowframe, windowtext, yellow
Safari 1.0 and later.
CSS 2.1
Defines an element's background image.
background-image: value |
Safari 1.0 and later.
CSS 2.1
Defines the origin of a background image.
background-position: value |
Safari 1.0 and later.
CSS 2.1
Defines the x-coordinate of the origin of a background image.
background-position-x: value |
Safari 1.0 and later.
Apple extension.
Defines the y-coordinate of the origin of a background image.
background-position-y: value |
Safari 1.0 and later.
Apple extension.
Defines the repeating qualities of the background image (for example, tiling it only in a certain direction or not at all).
background-repeat: value |
Safari 1.0 and later.
CSS 2.1
Defines the color of the text of an element.
color: value |
activeborder, activecaption, appworkspace, aqua, background, black, blue, buttonface, buttonhighlight, buttonshadow, buttontext, captiontext, fuchsia, gray, graytext, green, grey, highlight, highlighttext, inactiveborder, inactivecaption, inactivecaptiontext, infobackground, infotext, lime, maroon, match, menu, menutext, navy, olive, orange, purple, red, scrollbar, silver, teal, threeddarkshadow, threedface, thre