/

HTML / CSS / JavaScript Tutorial

CSS Property: all

[this page | pdf | back links]

The CSS (CSS3) all property resets all properties, apart from unicode-bidi and direction, to their initial or inherited values.

 

Valid property values  (other than inherit and initial) are:

 

Value

Description

unset

Changes all properties applied to element or its parent to their parent value if they are inheritable or to their initial value if not

 

Default Value:

N/A

JavaScript syntax:

e.g. object.style.all = "initial";

Inherited:

No

Animatable:

No

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
html {color: blue}
div.x1 {width: 280px; border: thin solid green; color: red;}
div.x2 {width: 280px; border: thin solid green; color: red; all: initial}
</style>
</head>
<body>
<div class="x1">Element without CSS all property applied</div><br><br>
<div class="x2">Element with CSS all property applied</div>

</body>
</html>

FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedCSSPropertyAll() {
  var x = document.createElement("DIV"); x.style.all = "unset"; return (window.getComputedStyle(x, null).all == "unset");
}


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile