html - clear float in the same element -
i have p.test given width , float:left. div takes half of full width. so, if create next element after p.test, go same line p.test. using p instead of div, because related tinymce staff , in scenario divs cannot use.
i want write css rule: "everything goes after p.test start on next line if p.test doesn't take 100% of width , floating left".
it related clearing float, problem cannot use container or add clear:both after p.test in html layout (again - because tinymce editor used). need purely css solution done "p.test" element or "element next p.test whatever is". maybe there other, not sure.
<p class="test"></p> <p>element should on next line whatever is</p> .test { width: 60%; float: left; }
you put clear: left
on first element don't want bubble beside floated element.
.test + * { clear: left; }
or … since has fixed width, don't float .test
in first place.
Comments
Post a Comment