div { border: 10px dotted black; padding: 15px; background-color: lightblue; margin: 20px; } .ex1 { background-clip: border-box; } .ex2 { background-clip: padding-box; } .ex3 { background-clip: content-box; }
<!DOCTYPE html> <html lang="ko"> <head></head> <body> <h1>background-clip</h1> <div class="ex1">background-clip: border-box</div> <hr> <div class="ex2">background-clip: padding-box</div> <hr> <div class="ex3">background-clip: content-box</div> </body> </html>