CSS revert Property

CSS Update

revert rolls back a CSS property back to the value that was previously cascaded. This can be used for reverting back to the property inherited from the parent (if the property exists), or reverting to the styles defined by the browser.

revert can be applied to any CSS property. Additionally it can be applied for all CSS properties using the all keyword.

body {
	color: black;

p {
	color: blue;

.revertp {
	color: revert;
	<!-- will have blue color -->
	<p>Sample text</p>
	<!-- will have black color -->
	<p class="revertp">Sample text</p>

revert can be useful for isolating styles of embedded widgets from the styles of the main page.

Browser Compatibility

Tutorials & Resources

August 7, 2020


Loading Comments