0

I have following html

 <div class="popover"> click to popoverpopover</div>

When user mouse hover on div there should be a popover

My css is following

.popover:hover 
{
    content:"popover";

    .popover:before
    {
        content:'';
        position: absolute;
        display: block;
        position: absolute;
        left: 15px;
        width: 0;
        height: 0;
        border: 7px outset transparent;
        bottom: -14px;
        border-top: 7px solid #555;
    }
}

But I just found out that in CSS I can't use class within another class.

Is there a way to achieve what I am trying.

Magicprog.fr
  • 4,072
  • 4
  • 26
  • 35
user4545762
  • 69
  • 1
  • 9

1 Answers1

0

You could use a data-* attribute to hold rollover text.

<div class="wrap">
  <span data-rollover="Tool tip">Check</span>
</div>

span:hover {
  font-size: 0;
}

span:hover:before {
  font-size: 16px;
content: attr(data-rollover);
}

Fiddle: http://jsfiddle.net/cgm3c2us/

General idea taken from: http://dabblet.com/gist/4286801

nikkypx
  • 1,925
  • 17
  • 12