initial
Quick Summary for initial
The initial CSS keyword applies the initial (or default) value of a property to an element. It can be applied to any CSS property. This includes the CSS shorthand all, with which initial can be used to restore all CSS properties to their initial state.
Code Usage for initial
<p>   <span>This text is red.</span>   <em>This text is in the initial color (typically black).</em>   <span>This is red again.</span> </p> 
More Details for initial

initial

The initial CSS keyword applies the initial (or default) value of a property to an element. It can be applied to any CSS property. This includes the CSS shorthand all, with which initial can be used to restore all CSS properties to their initial state.

On inherited properties, the initial value may be unexpected. You should consider using the inherit, unset, or revert keywords instead.

Examples

Using initial to reset color for an element

HTML
<p>   <span>This text is red.</span>   <em>This text is in the initial color (typically black).</em>   <span>This is red again.</span> </p> 
CSS
p {   color: red; }  em {   color: initial; } 
Result

Specifications

Specification
CSS Cascading and Inheritance Level 3 # initial

See also

Use unset to set a property to its inherited value if it inherits, or to its initial value if not. Use revert to reset a property to the value established by the user-agent stylesheet (or by user styles, if any exist). Use inherit to make an element's property the same as its parent. The all property lets you reset all properties to their initial, inherited, reverted, or unset state at once.

Last modified: Feb 21, 2022, by MDN contributors

Select your preferred language English (US)DeutschEspañolFrançais日本語한국어PolskiPortuguês (do Brasil)Русский中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote


Windows
Random CSS Property

<resolution>

The <resolution> CSS data type, used for describing resolutions in media queries, denotes the pixel density of an output device, i.e., its resolution.
resolution#dpi css reference