Setting the width of inline elements

后端 未结 7 1147
悲&欢浪女
悲&欢浪女 2020-11-22 05:28

You can set the width of inline elements like , and , but you won’t notice any eff

7条回答
  •  孤街浪徒
    2020-11-22 06:10

    a. Width of inline elements are ignored.

    b. Actually you can apply width to element if set display: inline-block; but to see results you also should apply overflow: hidden;.

    To have all benefits of inline and block types you can use follow snippet:

    display: inline-block; width: 50%; // or px, em, etc. overflow: hidden; text-overflow: ellipsis;

    In this case you can manage width and have text ellipsis feature.

提交回复
热议问题