Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67497

Div positioning (y-axis) is the same as previous div y-axis position, unwanted behavior

$
0
0

So i have this array that represents a math formula. For equation a / b, Structure is

[[a],/,[b]]

I've got it working on react and can display the values correctly, problem is the positioning of the last div, that takes the y-axis of the previous div. Expected result:

 ________________
| |     a      | |
|1|------------|2|
| |     b      | |
------------------

the creation of the divs goes: div1, div a, middle line, div b, div 2. Div 2 is behaving in a way that takes the y-axis (top position) of div b. Here is what i got:enter image description here As you can see highlighted the top position of div 2 is at the middle of the container, i want something that can automatically place the div at the top if theres no more space on a "column". Keep in mind this is supposed to be variable and the equation array can change. I've basically tried placing display inline, inline-block, block and others to no avail, plus float left, and even float left + right on the last one and still no luck. Codepen trying to replicate my problem: https://codepen.io/dariovillalta/pen/yLLrgEw


Viewing all articles
Browse latest Browse all 67497

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>