How to Set a Fixed Width for a Div Element with Display Inline?

后端 未结 1 1081
生来不讨喜
生来不讨喜 2021-01-02 04:34

I have the below div element:

Hello my friend, How are yo
相关标签:
1条回答
  • 2021-01-02 05:00

    Use display:inline-block;. Size properties are ignored at most elements with display:inline.

    <div style="width: 40px; height: 40px; overflow: hidden; display: inline-block;">
                Hello my friend, How are you?</div>
    
    0 讨论(0)
提交回复
热议问题