www.webdeveloper.com
Results 1 to 6 of 6

Thread: A control to display html code

  1. #1
    Join Date
    Apr 2005
    Posts
    210

    A control to display html code

    Many products are displayed on a page, each product has a long text description, which is dynamically created by php.

    I displayed product description in a <div>, but text is too long.
    I want a simple TAG, i.e. <textarea> to restrict text in a small area.
    But <textarea> doesn't show html TAG or format.

    Do you know which TAG or control can do this?

    Thanks.

    .

  2. #2
    Join Date
    Mar 2012
    Posts
    63
    you can show in a div with showable height and width and with the style to scroll

  3. #3
    Join Date
    Mar 2011
    Posts
    1,139
    He means use something like:
    Code:
    <div style="width:250px; height:120px; overflow:scroll;">
    <?php echo($description); ?>
    </div>
    In other words, enclose the PHP code that outputs the product description with <div> tags as shown above, and adjust the 'width' and 'height' settings in the style attribute as needed.
    Rick Trethewey
    Rainbo Design

  4. #4
    Join Date
    Apr 2005
    Posts
    210
    Hi rtrethewey,

    It's exactly what I need.

    Thanks a lot.

  5. #5
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,211

  6. #6
    Join Date
    May 2012
    Posts
    8
    use code with fixed (CSS) width and height, and then apply attribute "overflow:scroll"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles