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

170
Views
resize css rule changes other divs

I have several divs with css rule 'resize: both' on all of them. The problem is that when I start to resize any of them others move automatically. Is is possible to change that behaviour?

Tried 'position: absolute' but it isn't a solution, cause it collects all divs in one place. They are also will be draggable like notes, so I can't stick them to corners.

The resizable div should change its size over the others (with higher z-index or smth like this). Others should stay at their positions while resizing and after

code: https://jsfiddle.net/q3m5ya8f/

.el {
  resize: both;
  overflow-y: auto;
  border: 2px solid black;
  margin: 10px;
  height: 100px;
  width: 100px;
}

.container {
  display: flex;
  flex-direction: row;
}
<div class="container">

  <div class="el">
    1
  </div>

  <div class="el">
    2
  </div>

</div>


<div class="el">
  3
</div>

pic

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

0

Try using grid like below:

.el {
  resize: both;
  overflow-y: auto;
  border: 2px solid black;
}

.container {
  display: grid;
  /* the width / height here */
  grid-template-columns:100px 100px;
  grid-auto-rows:100px;
  gap: 10px;
}
<div class="container">
  <div class="el">
    1
  </div>

  <div class="el">
    2
  </div>

  <div class="el">
    3
  </div>
</div>

about 4 years ago · Juan Pablo Isaza Report

0

Well you can achieve this by position:absolute and position each of div using left/right/top/bottom properties separately like done in bellow snippet ( position can be your desired one I have taken for example ) :

.el {
  resize: both;
  overflow-y: auto;
  border: 2px solid black;
  margin: 10px;
  height: 100px;
  width: 100px;
  position: absolute
}

.el1 {
  left: 0
}

.el2 {
  right: 0
}

.el3 {
  bottom: 0
}

.container {
  display: flex;
  flex-direction: row;
}
<div class="container">

  <div class="el el1">
    1
  </div>

  <div class="el el2">
    2
  </div>

</div>


<div class="el el3">
  3
</div>

about 4 years ago · Juan Pablo Isaza Report

0

You can add one wrapper-div and give it fixed width and height:

.el{
  resize: both;
  overflow-y: auto;
  border: 2px solid black;
  margin: 10px;
  height: 100px;
  width: 100px;
}

.container{
  display: flex;
  flex-direction: row;
}

.wrapper-div{
  margin: 10px;
  width:100px;
  height:100px;
}
<div class="container">

  <div class="wrapper-div">
    <div class="el">
      1
    </div>
  </div>

  <div class="wrapper-div">
    <div class="el">
      2
    </div>
  </div>

</div>

<div class="wrapper-div">
  <div class="el">
    3
  </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!