-
Notifications
You must be signed in to change notification settings - Fork 2
block alignment
garevna edited this page Sep 1, 2019
·
7 revisions
<body>
<div class="box"></div>
</body>.box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #000;
color: #fff;
width: 300px;
height: 200px;
}<body>
<div class="box">
<div class="content"></div>
</div>
</body>.box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
width: 300px;
height: 200px;
}
.box > .content {
position: absolute;
background: #000;
top: 20px;
bottom: 10px;
box-sizing: border-box;
left: -30px;
width: calc(100% + 60px);
}
.box:before, .box:after {
content: "";
position: absolute;
width: 100%;
height: 100%;
}
.box:before {
border-top: 10px solid #f50;
border-left: 10px solid #f50;
}
.box:after {
border-bottom: 10px solid #f50;
border-right: 10px solid #f50;
}
Всемирная паутина
Пример
