3

I am trying to create a shape using CSS clip-path. jsfiddle is here.

My Code is:

CSS:

.kite {
    width: 280px;
    height: 280px;
    background: #1e90ff;
    border: 4px solid # 222; - webkit - clip - path: polygon(0 0, 52 % 0, 100 % 100 % , 0 52 % );
    clip - path: polygon(0 0, 52 % 0, 100 % 100 % , 0 52 % );
}
.kite: hover {
    opacity: 0.6;
}

/* Center the demo */
html,
body {
    height: 100 % ;
}
body {
    display: flex;
    justify - content: center;
    align - items: center;
}

HTML:

<div class="kite"></div>

This shape needs to have a border with black color, but the CSS currently does not create the border for the entire shape but only for the div.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Aqdas
  • 868
  • 4
  • 16
  • 57

0 Answers0