Interactive online courses HTML Academy
2026-03-09 10:58 Diff

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Muffin’s Round Frame, Part 2

Now that the graphic frame is ready, we will round off the portrait of Muffin, then hide the unneeded part of the background by cropping background-clip and removing the auxiliary outer frame.

Therefore, our round portrait in a round frame is ready!

Comments

  • index.html
  • style.css

HTML

<!DOCTYPE html> <html lang="en"> <head> <title>Muffin’s Round Frame, Part 2</title> <meta charset="utf-8"> <link rel="stylesheet" href="setting.css"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="portrait"></div> </body> </html>

CSS

.portrait { margin: 50px auto; width: 300px; height: 300px; outline: 5px solid white; border: 50px solid rgba(0, 0, 0, 0.4); border-image-source: url("img/leafs-frame.png"); border-image-slice: 180 fill; background: url("img/muffin-3.jpg") center no-repeat rgba(255, 255, 255, 0.4); background-size: cover; }

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%

  1. For the portrait, set 50% rounding for the corners,
  2. crop the background of the content-box, and
  3. remove the outline outer frame.