How to create a tooltip?

后端 未结 4 966
隐瞒了意图╮
隐瞒了意图╮ 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

    .tooltip {
        position: relative;
        display: inline-block;
        border-bottom: 1px dotted black;
    }
    
    .tooltip .tooltiptext {
       
        max-width:100px;
        padding:15px;
        min-height:30px;
        background:red;
        visibility: hidden;
        border: 1px solid black;
        color: #000;
        text-align: center;
        border-radius: 6px;
        /* Position the tooltip */
        position: absolute;
        z-index: 1;
    }
    
    .tooltip:hover .tooltiptext {
        visibility: visible;
    }
    
    
    

    Move the mouse over the text below:

    Hover over me 1 Tooltip text
    Hover over me 2 Array [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,,1,11,1,1,1,11,1,,1,1,1,1,1,1,1,1,1,1,1,1,1,1]

提交回复
热议问题