CSS content-box Value

Use the CSS background-origin property to set the content-box value. With the content-box value, the background image begins from the upper left corner of the content.

You can try to run the following code to implement the content-box value:

Example


   
      
   

   
      

padding-box value

     
         

Heading 2

         

This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.          

Heading 3

         This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.      
     

border-box value

     
         

Heading 2

         

This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.          

Heading 3

         This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.      
     

content-box value

     
         

Heading 2

         

This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.          

Heading 3

         This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.      
   
Updated on: 2026-03-11T22:50:41+05:30

252 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements