Как сверстать такой background image c внутренней рамкой?
Задача сверстать такой background c внутренней рамкой, ссылка на макет https://www.figma.com/file/SB9yy4U3zdpzxaxjEpguHw/Sofi-de-Marko?node-id=178%3A2
Ответы (2 шт):
Автор решения: Вадим
→ Ссылка
.wrapper {
width: 800px;
height: 600px;
background-color: #333;
padding: 20px;
}
.item {
color: #fff;
text-align: center;
width: 100%;
height: 100%;
border: 2px solid #fff;
}
<div class="wrapper">
<div class="item">
<h1>Welcome</h1>
</div>
</div>
Автор решения: Денис Степанов
→ Ссылка
.box {
background: rgba(0, 0, 0, 0.5);
color: #fff;
margin: 50px;
position: relative;
height: 200px;
}
.box:before {
content: "";
border: 2px solid #fff;
position: absolute;
top: 10px;
bottom: 10px;
left: 10px;
right: 10px;
}
<div class="box"></div>
