0

In below codes, there is style="float: left;" that make the image float.

<p><img alt="" class="image-medium" src="http://localhost/d7/files/styles/medium/public/about-us/images/2012/02/28/img.jpg" style="float: left;" title="" />Ut scelerisque pulvinar nisi eget ultricies. Fusce iaculis risus vel nunc aliquam hendrerit. Fusce et bibendum justo. In ultricies quam at libero dapibus eu fermentum ipsum eleifend. Proin at libero nulla. Mauris adipiscing, odio vel tempus dapibus, odio dolor pellentesque neque, ac adipiscing enim purus tincidunt mauris. Nunc elementum euismod tellus ut commodo. Aliquam nec felis nunc. Suspendisse et turpis nec purus auctor ultrices sed ut arcu. Mauris suscipit scelerisque tortor, id feugiat sapien lacinia vel. Phasellus congue tellus sed est blandit eu gravida ipsum ultrices. Vestibulum orci leo, condimentum at adipiscing in, scelerisque et odio.</p>

Without HTML filtering, it works. But if using HTML, what tag should I add to make the picture float?

Currently, below is my tags:

<a> <p> <span> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption> <s> <textarea>

2 Answers 2

2

You can use class="left" in your HTML, and .left {float:left;} in you CSS.

0

The issue is that the input filters strip out the class= and style= tag out, even if they are inside allowable tags. The quick solution is to figure out what DIV or SPAN encloses your text and then have css built up for that, eg, in a .css file have:

WHATEVERDIV img {
   float: left;
}

which would cause all imgs inside your div to float. If you need to get more fine grained than that, you could work with css selectors to target specific images (which can get ugly and not too supportable if they images change, etc.)

2

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.