CSS
10
Вклад в тег
<div class="container">
<section class="news">
<div class="news__item">Новость</div>
<div class="news__item">Новость</div>
<div class="news__item">Новость</div>
<div class="news__item">Новость</div>
<div class="news__item">Новость</div>
</section>
<aside class="sideBar">Боковое меню</aside>
</div>
.container{
display: flex;
max-width: 1200px;
background: #eee;
margin: 0 auto;
}
.news{
display: flex;
flex-wrap: wrap;
flex-grow: 1;
background: lightgreen;
}
.news__item{
flex-basis: 200px;
flex-grow: 1;
height: 300px;
margin: 10px;
background: lightblue;
}
.sideBar{
flex-grow: 1;
max-width: 400px;
}
let wrap = document.querySelector('.wrap');
wrap.onclick = ()=> wrap.classList.toggle('noMagic');
.wrap{
position: relative;
width: 500px;
height: 200px;
background: lightblue;
margin: 0 auto;
}
.wrap::before{
position: absolute;
content: 'Кликни на меня, детка!';
height: 50px;
width: 100%;
background: lightgreen;
transition: 2s;
}
.noMagic.wrap::before{
content: 'А ты молодец!';
display: flex;
justify-content: center;
align-items: center;
animation: move 1s forwards;
}
@keyFrames move{
100% {
height: 100%;
}
}
border: 1px solid #000;
margin:-1px 0 0 -1px;
.item{
width: 200px;
height: 200px;
box-shadow:
1px 0 0 0 #000,
0 1px 0 0 #000,
1px 1px 0 0 #000,
1px 0 0 0 #000 inset,
0 1px 0 0 #000 inset;
}