HTML+CSS: How to force div contents to stay in one line?

后端 未结 10 1987
小蘑菇
小蘑菇 2020-11-30 17:52

I have a long text inside a div with defined width:

HTML:

Stack Overflow is the BEST !!!

CSS:



        
10条回答
  •  佛祖请我去吃肉
    2020-11-30 18:13

    div {
        display: flex;
        flex-direction: row; 
    }
    

    was the solution that worked for me. In some cases with div-lists this is needed.

    some alternative direction values are row-reverse, column, column-reverse, unset, initial, inherit which do the things you expect them to do

提交回复
热议问题