jquery - sibling divs jump to new line when resizing -
I am creating 3 rows and I am creating 4 columns in each row. But what I am trying to achieve is that 1 when any column is changed to one row, then the remaining column should be resized according to the total remaining width of the row. Suppose that the total width of the line is 100% and if I change the size of 60% to 1% then the remaining three columns should be taken according to the remaining 40%. As it happens in my HTML, its size does not change, the rest of the column runs below.
This is my code.
& lt; Div id = "data-1" & gt; & Lt; Div class = "line" style = "width: 100%;" & Gt; & Lt; Div class = "column" style = "float: left; overflow: hidden; minimum-width: 25%;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "line" style = "width: 100%;" & Gt; & Lt; Div class = "column" style = "float: left; overflow: hidden; minimum-width: 25%;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "line" style = "width: 100%;" & Gt; & Lt; Div class = "column" style = "float: left; overflow: hidden; minimum-width: 25%;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; Div class = "column" style = "minimum-width: 25%; float: left; overflow: hidden;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; According to this I come under the structure:
But when I change the size of a column, I get this:
I want to receive it again:
Pryu in CSS Media Queries and display table and display table-cell Like CSS .row {display: table; Width: 100%; } .column {display: table-cell; Height: 20px; Border: Solid 1px red; } @ Media All and (max-width: 500px) {# data-1 .row: First-Child & gt; .column: First-child {width: 60%;}} HTML & lt; Div id = "data-1" & gt; & Lt; Div class = "row" "& gt; div class =" column "& gt; & lt; / div & gt; & lt; div class =" column "& gt; & lt; / div & gt; & lt; Div class = "column"> = "Row" "& gt; & Lt; Div class = "column" & gt; & Lt; / Div & gt; & Lt; Div class = "column" & gt; & Lt; / Div & gt; & Lt; Div class = "column" & gt; & Lt; / Div & gt; & Lt; Div class = "column" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" "& gt; div class =" column "& gt; & lt; / div & gt; & lt; div class =" column "& gt; & lt; / div & gt; & lt; / P>
Comments
Post a Comment