I would like to apply a border to only specific corners of a container, similar to the image below. There is a little border at the corner of the summary containers bellow. How can I achieve this? Thank you in advance.
first value applies to top-left corner, second value applies to top-right corner, third value applies to bottom-right corner, and fourth value applies to bottom-left corner.
This answer is focusing more on approach than beautiful design or pattern.
The approach is to have:
1x div as item container with relative position
4x div as corners with absolute position at top-left, top-right, bottom-right and bottom-left and have them showed their corresponding corner border radius as 1/4 Arc.
Remember border-radius has 4 values for each corner like 0px 0px 5px 5px to draw radius only in bottom-right and bottom-left corner, for your 1st top image.
3
Answers
border-radius:0px 0px 30px 30px;
first value applies to top-left corner, second value applies to top-right corner, third value applies to bottom-right corner, and fourth value applies to bottom-left corner.
border-bottom-right-radius: 25px ;
border-bottom-left-radius: 25px;
You can write it in a single line.
border-radius:0px 0px 25px 25px;
To set different values for each corner, use the following syntax
border-radius: top-left top-right bottom-right bottom-left;
This answer is focusing more on approach than beautiful design or pattern.
The approach is to have:
border-radius
has 4 values for each corner like0px 0px 5px 5px
to draw radius only in bottom-right and bottom-left corner, for your 1st top image.It looks like this at the end:
The html codes let’s say
index.html
And CSS codes
styles.css
:From there you can apply for other items with their own colors, and use appropriate pattern if using CSS framework.