Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #908802
    anzwers
    Participant

    Hi dear support, I would like to know if there is a way to truncate a string (a sencence) via css based on the screen resolution (or via php…).

    Something like:

    @media (min-width: 500px) { truncate 25 etc
    @media (min-width: 800px) { truncate 35 etc

    Now I truncate (in one of my widgets) a string always after 25 caracters, but on “big screen” it is not so nice.
    Thank you!!!

    Augusto

    #908895
    Christopher
    Moderator

    Hi there,

    You can use following property, but it doesn’t work base numbers of characters, it works base on element’s width, if text width gets larger than element’s width the text won’t be displayed.

    Please add following code in Customize -> Custom -> CSS :

    .my-class{
    text-overflow: ellipsis;
    }

    Hope it helps.

  • <script> jQuery(function($){ $("#no-reply-908802 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>