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
Write a simple shortcode to add a <div style="clear: both;"> </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!!!– alexndmApr 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– kaiserApr 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 DunnMay 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.