🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to CSS Notes
Topic #121

Background Clip


CSS background-clip Property

The CSS background-clip property defines how far the background (color, image, or gradient) should extend within an element.

This property can have one of the following values:

  • border-box - The background extends behind the border. This is default
  • padding-box - The background extends to the inside edge of the border
  • content-box - The background extends to the edge of the content box

Example

   #div1 {
  border: 5px dotted black;
  padding: 35px;

   background-image: url(paper.gif);
  background-clip: border-box;

   }

#div2 {

   border: 5px dotted black;
  padding: 35px;

   background-image: url(paper.gif);
  background-clip: padding-box;

   }

#div3 {

   border: 5px dotted black;
  padding: 35px;

   background-image: url(paper.gif);
  background-clip: content-box;

   }

Example

   #div1 {
  border: 5px dotted black;
  padding: 35px;

   background-color: lightblue;
  background-clip: border-box;

   }

#div2 {

   border: 5px dotted black;
  padding: 35px;

   background-color: lightblue;
  background-clip: padding-box;

   }

#div3 {

   border: 5px dotted black;
  padding: 35px;

   background-color: lightblue;
  background-clip: content-box;

   }

CSS Advanced Background Properties

Property Description
background A shorthand property for setting all the background properties in one declaration
background-clip Specifies the painting area of the background
background-image Specifies one or more background images for an element
background-origin Specifies where the background image(s) is/are positioned
background-size Specifies the size of the background image(s)

Want to go beyond the notes?

Join CodingNow 2.0's CSS course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Background Clip – FAQs

Quick answers about learning Background Clip in CSS.

This free note from CodingNow 2.0 explains Background Clip in CSS — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every CSS topic on CodingNow 2.0, including Background Clip, is 100% free with no signup required.
With focused practice, most students grasp Background Clip in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now