[css] How can I stop float left?

I have the following code:

<div style="float: left; width: 100%;">
  <label style="float: left;">ABC</label>  
  <input style="float: left; font-size: 0.5em;" type="button"   onclick="addTiny(0,'Question_Text'); return false;" value="&#x25BC;" title="Editor" />   
  <input style="float: left; font-size: 0.5em;" type="button" onclick="remTiny(0,'Question_Text'); return false;" value="&#x25B2;" title="Hide" />   

  <div class="adm">
    <textarea rows="2;" style="width: 100%" class="text-box multi-line mceEditor">
      abc
    </textarea>
  </div>
</div>

My problem is that the div with class adm floats to the left and so goes on the same line as the label and two input buttons. Is there a way that I can make this shift away from floating?

This question is related to css html css-float

The answer is


There's a class in bootstrap for it

class="clearfix";


You could modify .adm and add

.adm{
 clear:both;
}

That should make it move to a new line


The css clear: left in your adm class should stop the div floating with the elements above it.


A standard approach is to add a clearing div between the two floating block level elements:

<div style="clear:both;"></div>

For some reason none of the above fixes worked for me (I had the same problem), but this did:

Try putting all of the floated elements in a div element: <div class="row">...</div>.

Then add this CCS: .row::after {content: ""; clear: both; display: table;}


You should also check out the "clear" property in css in case removing a float isn't an option


add style="clear:both;" to the "adm" div.


Sometimes clear will not work. Use float: none as an override


Okay I just realized the answer is to remove the first float left from the first DIV. Don't know why I didn't see that before.


Just add overflow:hidden in the first div style. That should be enough.


Examples related to css

need to add a class to an element Using Lato fonts in my css (@font-face) Please help me convert this script to a simple image slider Why there is this "clear" class before footer? How to set width of mat-table column in angular? Center content vertically on Vuetify bootstrap 4 file input doesn't show the file name Bootstrap 4: responsive sidebar menu to top navbar Stylesheet not loaded because of MIME-type Force flex item to span full row width

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to css-float

Bootstrap - floating navbar button right Bootstrap change div order with pull-right, pull-left on 3 columns Bootstrap 3 Multi-column within a single ul not floating properly CSS float right not working correctly Floating Div Over An Image CSS force new line Why doesn't the height of a container element increase if it contains floated elements? Advantages of using display:inline-block vs float:left in CSS Floating divs in Bootstrap layout What does the CSS rule "clear: both" do?