How to create a tooltip?

后端 未结 4 943
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 03:15

I want to make a custom CSS class for tooltip which will wrap a string of length more than 25-30.Usually such a long text doesn\'t fit into the tootltip text area.

4条回答
  •  自闭症患者
    2020-12-04 03:27

    You can create a use some css tricks which will resize the tooltip according to content.

    Here is some example with assumptions of width and height.

    .tooltip{
        max-width:100px;
        padding:15px;
        min-height:30px;
        background:#000;/*change accordingly*/
    }
    

    Above css will create a div with fix maximum width and resizeable height which will fit you content.

提交回复
热议问题