How to keep text inside the parent?

后端 未结 4 915
终归单人心
终归单人心 2020-12-21 06:52

Lets say take this as an example:



    
        Test
        

        
4条回答
  •  春和景丽
    2020-12-21 07:19

    This is unlikely that you will have a single word or string such long length without any spaces. Please reconsider the length of your actual content. Using overflow:hidden you will only hide the extra text outside of the container, i assume thats what you wouldn't want. If you really need a single word which is this much (or even more) long then you need to use word-wrap:break-word or word-break:break-word. Still you can read the following posts for further reference.

    how to use automatic css hyphens with word-break: break-all?

    How to break long words in a table td?

    http://kenneth.io/blog/2012/03/04/word-wrapping-hypernation-using-css/

提交回复
热议问题