html - How can I reorder my divs with CSS? -
given template html cannot modified because of other requirements, how possible display (rearrange) div
above div
when not in order in html? both div
s contain data varies in height , width.
<div id="wrapper"> <div id="firstdiv"> content below in situation </div> <div id="seconddiv"> content above in situation </div> </div> other elements
hopefully obvious desired result is:
content above in situation content below in situation other elements
when dimensions fixed easy position them needed, need ideas when content variable. sake of scenario, please consider width 100% on both.
i looking css solution (and have met other solutions if doesn't pan out).
there other elements following this. suggestion mentioned given limited scenario demonstrated -- given might best answer, looking make sure elements following aren't impacted.
this solution uses css , works variable content
#wrapper { display: table; } #firstdiv { display: table-footer-group; } #seconddiv { display: table-header-group; }
Comments
Post a Comment