How to clear floats in WYSIWYG editor? Not everyone know how to add <div style="clear:both>" in HTML mode. Is there any way to add extra button to WYSIWYG or plugin. TineMCE doesn't have that option.

2 Answers 2


Write a simple shortcode to add a <div style="clear: both;">&nbsp;</div>

Detailed Explanation: http://brettterpstra.com/adding-a-tinymce-button/

  • shortcode is great idea, but couldn't add custom button following that tutorial, maybe WP 3.1 has changed the way buttons are added. Thank for pointing me in this direction!!!
    – alexndm
    Apr 23, 2011 at 17:43
  • This doesn't work? I copy/pasted it into a gist. Download and give it a try as plugin: gist.github.com/938844#comments
    – kaiser
    Apr 23, 2011 at 18:19
  • Setting "overflow: auto" in CSS is a much better way of clearing floats than adding extra markup -- blogs.sitepoint.com/simple-clearing-of-floats
    – Ian Dunn
    May 23, 2011 at 22:39

Try the WordPress plugin TinyMCE Clear Float. It uses the following HTML markup: <br style="clear: both;">. Give it a try.

Disclaimer: I'm the author of this plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.