Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help - truncated content in the middle of an html tag

    hi,

    im using a cms that truncates content after 300 characters and sometimes the truncation is in the middle of an html tag (a href, span, etc.). When the content is truncated in the middle of a tag, the tag shows (which makes the UI downright ugly). Sooo....I was wondering is there a way to keep content together so that if a tag is in the middle of a truncation...that tag will be pushed to a new line? is there a special div tag or javascript function that can do this?

    i know it sounds confusing but, please ask questions for clarification.

    thanks,
    moves

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    it is confusing, indeed... Well, javascript can not change the real line structure of a page, it is only a dynamic language.... Changes are "virtual", available only durring the session.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    Mar 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here's a visual:


  • #4
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    There's no easy way to solve your problem dynamically. Your best bet is to count your characters before you put them in your CMS.


  •  

    Posting Permissions

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