1

I am designing a comment frame for a webpage I am working on. Upon using nl2br to ensure line-breaks aren't removed from stuff submitted from the the in the form, the text just wraps around the user image in the comment section (please see image). overflow:hidden doesn't work here. How to handle this?

A screenshot of the comment frame.

<div class="comment_section" style="overflow:hidden";>
    <a href="<?php echo $posted_by?>" target="_parent"><img src="<?php echo $user_obj->getProfilePic();?>" title="<?php echo $posted_by;?>" style="float:left;" height="30"></a>
    <a href="<?php echo $posted_by?>" target="_parent"><b><?php echo $user_obj->getFirstAndLastName();?></b></a>&nbsp;&nbsp;&nbsp;&nbsp; <?php echo $time_message . "<br>" . nl2br($comment_body);?>
    <hr>
</div>
Tobias Wilfert
  • 919
  • 3
  • 14
  • 26
shelldon
  • 11
  • 1
  • Disable float left – Peter M Dec 08 '18 at 12:40
  • This hasn't helped I have tried it in the past: a) It will push the picture up top, and b) overflow: hidden; will still not work to stop the text from wrapping. – shelldon Dec 08 '18 at 17:27
  • Put the comment inside a container like ‘div’ and put the float left on the div. – Peter M Dec 08 '18 at 22:37
  • Please add the generated HTML (not the PHP that generates it) and the related CSS so we can see the issue directly on the question. Read about how to create a [mcve] for more information. – Alvaro Montoro Dec 10 '18 at 19:51

0 Answers0