The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS random quote in a fixed size block

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #43663

    I have a script that pulls in random blockquote.
    The api is here
    And the script running in js fiddle with my own css and container.

    As I have no idea how many lines of copy the biggest quote is,
    What I need it to do is have the font size scale down when the number of lines exceed the fixed height proportionately. But it also needs to scale up when its only a few words also.

    Here’s the code with a forced amount of text as an example to work with.
    (id imagine it overflowing the container is part of the problem)

    I’ve used fit text js before but it only scales width. And I have seen the following post but similar but most do the same.
    I need the opposite.

    It needs to flow to the next line till it runs out of height then scale down and not flow outside the container or scroll. And not via viewport but a fixed div container.

    I should also mention, I can edit and understand most JS but I cant write it to save my life.

    Any ideas?

    Failing that working, the fallback would be to push the bottom of the container down and not allow text to overflow like its currently doing.


    I found this and it did look promising.

    It works great with static text.

    But it seems to conflict with the other script and css.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.