html - CSS hovering div link -


i using following css create popout menu information when user hovers on particular link. how can modify follow code user click on link within span? of right second mouse moves off original link, div disappears.

a:hover { position: relative; }  span { display: none; }  a:hover span { color:#006699; display: block; position: absolute; width:190px; height:12px; top: -15px;  left: 30px; padding: 5px;   z-index: 100; }  <a href=email.php>email<span>text</span></a> 

that not valid html have there - block level p tags cannot contained in inline a , span tags. , if you're using html5, changed rules elements can inside other elements, still can't have anchors inside anchors - doesn't make sense.

what can do, instead, use adjacent sibling selectors job, having popup element appear next anchor in document markup instead of inside it.

however, it's recommended use javascript control behavioural elements of site - javascript offers greater control on how popup behaves, , better suited this.


Comments

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

c# - HwndSource win32 integration with Ribbons and KeyTips -