Insert ellipsis (…) into HTML tag if content too wide

后端 未结 24 3010
名媛妹妹
名媛妹妹 2020-11-22 10:07

I have a webpage with an elastic layout that changes its width if the browser window is resized.

In this layout there are headlines (h2) that will have

24条回答
  •  情深已故
    2020-11-22 10:52

    I was a bit surprised by the behavior of the css though.

    var cssEllipsis = 
    {   "width": "100%","display": "inline-block", 
    "vertical-align": "middle", "white-space": "nowrap", 
    "overflow": "hidden", "text-overflow": "ellipsis" 
    };
    

    Unless I provided the width to the control to which i needed to bind the ellipsis didn't suppost my cause. Is width a must property to be added ??? Please put your thoughts.

提交回复
热议问题