skip to Main Content

I am using a custom template and just added:

<span class="custom-tooltip">
    <a href="#" class="tooltip-toggle">Test ?</a>
    <span class="tooltip-content">Tolltip description come here</span>
</span>

and than added below style code in my theme styles-l.css

.custom-tooltip {
    .lib-tooltip(right);
}

but its not working, am I doing wrong or missing.

Please suggest

2

Answers


  1. Add following code is in less file

    .custom-tooltip {
        .lib-tooltip(right);
    }
    

    and run bin/magento setup:upgrade command

    checked in magento version 2.1.7 to magneto version 2.2.2

    Login or Signup to reply.
  2. The code below can be just added to .phtml template:

            <div class="field-tooltip toggle">
                <span class="field-tooltip-action action-help"
                      data-bind="mageInit: {'dropdown':{'activeClass': '_active'}}" data-toggle="dropdown"
                      aria-haspopup="true" aria-expanded="false"></span>
                    <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true">
                        It is default Magento tooltip. Already styled.
                    </div>
                </div>
            </div>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search