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
For a long time it had seemed to me that life was about to begin - real life. But there was always some obstacle in the way, something to be gotten through first, some unfinished business, time still to be served, or a debt to be paid. Then life would begin. At last it dawned on me that these obstacles were my life.
Alfred D. Souza
Random CSS Property

column-width

The column-width CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the column-width value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width.
column-width css reference