Answer the question
In order to leave comments, you need to log in
How to fix the first element?
I'm making a news list. All news are maps except the first one - Codepen
For the first map, I change direction from column to row using the : pseudo first-child
- class
.article-card {
display: flex;
flex-direction: column;
margin: 0.5rem 0.6rem;
width: 280px;
background-color: #ffffff;
border-radius: 0.2rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
/* Вот тут хочется всё менять */
.article-card:first-child {
display: flex;
flex-direction: row;
margin: 0.5rem 0.5rem;
width: 100%;
background-color: #ffffff;
border-radius: 0.2rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
width: 100%;
height: auto;
on the contrarywidth: auto;
height: 100%;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question