Fortytwo Fortytwo - 1 month ago 10
CSS Question

How can I add a border to the right side of this object?

How can I add a border to the right side of this object to complete the square with the same properties as the border of the left. Adding box-shadow: 20px 0 0 0 red; does not work but overrides the left border.

https://jsfiddle.net/kheuz1z4/

HTML


CSS

#borders {
border-top: 20px solid black;
box-shadow: -20px 0 0 0 red;
border-bottom: 20px solid green;
height: 150px;
margin: 30px;
width: 150px;
border-radius: 20px 20px 0px 0px;
}

Answer

You can comma seperate box-shadow:

  #borders {
  border-top: 20px solid black;
  box-shadow: -20px 0 0 0 red, 20px 0 0 0 red;
  border-bottom: 20px solid green;
  height: 150px;
  margin: 30px;
  width: 150px;
  border-radius: 20px 20px 0px 0px;
}

Source: Is there a way to use two CSS3 box shadows on one element?

Comments