CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

CSS content Property

CSS content Property

 

 

The content property is used with the ::before and ::after pseudo-elements, to insert generated content.

 

Default Value:-

 

Its default value is normal.

 

Syntax:-

 

Its syntax is:- content: normal | none | counter | attr | string | open-quote | close-quote | no-open-quote | no-close-quote | url | initial | inherit;

 

Further Explanation:-

 

Value Description
normal Sets the content to normal.
none Sets the content to nothing.
counter Sets the content as a counter
attr(attribute) Sets the content as one of the selector attribute
string Sets the content to the text.
open-quote Sets the content to be an opening quote
close-quote Sets the content to be a closing quote
no-open-quote Removes the opening quote from the content.
no-close-quote Removes the closing quote from the content.
url(url) Sets the content to be some kind of media.
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Properties

All Sections related to CSS