A
A
Alisa712021-06-24 13:32:57
css
Alisa71, 2021-06-24 13:32:57

There is a block with a photo and a border, how to add such rounded corners using after and before?

There is a block with a photo and a border added with before
60d45e9edc326515884888.png

, here is the code

.test{
width:500px;
height:400px;
border-left:15px solid red;
border-right: 15px solid red;
position:relative;
border-radius: 4px

}
.test:before{
position:absolute;
display:inline-block;
width:90%;
height:16px;
top:0;
left:0;
content:'';
background color: red
}

How to make such rounded corners as in the photo? Tell me please
60d45f1ca1561410084976.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ankhena, 2021-06-24
@Alisa71

On choice, with pseudo and absolute or without him.
https://jsfiddle.net/rchpmf0y/
https://jsfiddle.net/ude1w987/ Better
yet , grids : https://jsfiddle.net/4smtphxz/

D
Dyusha Metelkin, 2021-06-24
@Neobezatelno

send full picture as it should be

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question