CodePudding user response:
I'm a newbie experience, floating is not easy to control, layui don't have to float the more professional, there are many ways to achieve the effect, such as absolute positioning, add window size change events absolute positioning adjustment value; Packed in div, sets the div to inline blocks, it can automatic left aligned arrangement; If there is right aligned with form can also be solved, the width of the 100%, left on the left side of form, form on the right side to align right, the window size changes, will form the adaptive adjustmentCodePudding user response:
Don't have to struggle so much, to remove the floating only when you take off the elements need placeholder would consider//no placeholder, take off the
The floating element & lt;/div>
//placeholder, but still out of standard flow
//placeholder, but still out of standard flow
The floating element & lt;/div>
Can also be removed by pseudo elements floating implementation
The back of the floating new added a label. The clear {clear: both}
Using pseudo variable such as: clearfix: before, clearfix: after {content: '; Display: table; }. Clearfix: after clear: both. Attach clearfix {* zoom: 1;/* here is for ie6, 7 the means of processing/}
Clearfix: after {
content:""; (this is to set up a pseudo element is empty)
Height; 0;
display:block; (set the pseudo elements for block-level elements)
clear:both; (remove the element at the front of the floating)
}
Clearfix {
Zoom: 1; (compatible with ie6)
}
Another is to float the parent element set overflow: hidden; But it will be suspected of cheating, not recommended to use
Can also be removed by pseudo elements floating implementation
CodePudding user response:
Overflow: hiddenThe back of the floating new added a label. The clear {clear: both}
Using pseudo variable such as: clearfix: before, clearfix: after {content: '; Display: table; }. Clearfix: after clear: both. Attach clearfix {* zoom: 1;/* here is for ie6, 7 the means of processing/}
CodePudding user response:
Add a clearfix to float the parent elementClearfix: after {
content:""; (this is to set up a pseudo element is empty)
Height; 0;
display:block; (set the pseudo elements for block-level elements)
clear:both; (remove the element at the front of the floating)
}
Clearfix {
Zoom: 1; (compatible with ie6)
}
Another is to float the parent element set overflow: hidden; But it will be suspected of cheating, not recommended to use
CodePudding user response:
Know the Flex layout so that no longer floating, won't have the weird layout techniques,CodePudding user response:
floating it really can be put into the dustbin of history, before the flex, no necessary to use floatCodePudding user response:
After a flex, float is not workingCodePudding user response:
Give points to pointsCodePudding user response: