lundi 13 juin 2016

CSS: Rounded borders only on the outside corners of an element

How could I go about constructing something like this with pure CSS?

SS

This is how far I've gotten so far: Fiddle

I'm struggling with how to get that rounded corner there, even if I continue to add additional spans.

CSS:

body {
  background: #000;
}

.container {
  position: relative;
  width: 300px;
  height: 150px;
  margin: 10% auto;
}

.top-right {
  position: absolute;
  top: -10px;
  right: 0;
  width: 50px;
  height: 1px;
  background: white;
  border-radius: 5px;
}

.box {
  width: 100%;
  height: 100%;
  background: red;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

h3 {
  color: white;
}

Aucun commentaire:

Enregistrer un commentaire