CSS border-box Value

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

You can try to run the following code to implement the border-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

309 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements