Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
How to complete rwd picture requirements without adding HTML

I have a project whose original screen structure is like the program example I attached!

Now the design draft requires that the original yellow block must appear below the green block on mobile devices, but my original HTML It is already arranged like this. I feel that if it is difficult to implement such a screen on a mobile device, I don't know how to accomplish such a screen change through css without adding HTML?

.demo {
  display: flex;
  justify-content: space-between;
}
.demo .main {
  flex: 2;
  background-color: #FBD148;
}
.demo .main .article {
  background-color: #49FF00;
  height: 200px;
}
.demo .main .reply {
  background-color: #3DB2FF;
  height: 200px;
}
.demo .about {
  flex: 1;
  background-color: #FBFF00;
  height: 200px;
}
<div class="demo">
  <div class="main">
       <div class="article">article</div>
       <div class="reply">reply</div>
  </div>
  <div class="about">about</div>
</div>

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For solve this, the better way is to use display: grid in demo and main classes. The demo class will have two columns and two rows. In main will has only auto rows. With @media query we are redefine grid colums and rows in the demo and place the yellow element between green and blue.

:root {
  --height: 200px;
}

.demo {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, var(--height));
}

.demo .main {
  display: grid;
  grid-auto-rows: var(--height);
  background-color: #fbd148;
}

.demo .main .article {
  background-color: #49ff00;
}

.demo .main .reply {
  background-color: #3db2ff;
}

.demo .about {
  background-color: #fbff00;
}

@media screen and (max-width: 768px) {
  .demo {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, var(--height));
  }
  .about {
    grid-column: 1;
    grid-row: 2;
  }
  .reply {
    grid-row: 3;
  }
}
<div class="demo">
  <div class="main">
    <div class="article">article</div>
    <div class="reply">reply</div>
  </div>
  <div class="about">about</div>
</div>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!