I have a number of elements that are float: left; Each other. Ideally, I would like to clear the float on both sides of one element with one class, without adding the other to clear: left; after non-floating element.
float: left;
clear: left;
An example where .one-line should be in its own line.
.one-line
How I do it now with two classes.
I feel this should be done without a few classes. Any ideas?
It seems dirty to me, but it does what you want (and even works in IE8). Adding a field to the same class will stop something from floating to the right and force them to move to the next line.
.one-line { clear: both; margin-right:100%; }
JsFiddle example
give it margin-right 100%
margin-right
.button { width: 50px; height: 50px; background-color: lightblue; margin: 10px; border-radius: 60px; float: left; } .one-line { clear: both; margin-right:100%; }
Source: https://habr.com/ru/post/973989/More articles:Animated Static PDF Conversion Slides - pdfWhy is this non-floating margin crumbling with a float? - cssGoogle Advertising ID for Amazon devices - androidUnable to install RMySQL on R 3.0.2 (ubuntu 14.04) - mysqlHow to change the orientation direction of the boot cursor on a click event - javascriptinstalling RMySQL gives an error RS-MySQL.h: 32: 19: fatal error: mysql.h: no such file - rCan I generate a smooth font size greater than 149? - fontsMulti-rental: an individual database for each tenant - c #How can I get all window handlers using a process in Powershell? - powershellXamarin Form Cards - Custom Contact Images - xamarin.formsAll Articles