保持我的css弹出窗口打开,直到我在弹出窗口外单击

时间:2013-10-30 00:36:00

标签: css

我正在尝试保持我的css弹出窗口打开,这样任何人都可以从弹出窗口复制文本,但每次鼠标点击都会弹出窗口关闭...除非鼠标在弹出窗口外点击,否则我怎么能保持打开?

我试图添加:

a.tooltip-reports:active { display: block; }

但这没有用......

我的css:

 /* click tooltip : reports.php */
a.tooltip-reports { cursor:pointer; outline:none; }
a.tooltip-reports strong { line-height:16px; }
a.tooltip-reports:focus { text-decoration:none;}
a.tooltip-reports span { z-index:10; display:none; padding:10px 10px; margin-top:25px; margin-left:-165px; width:270px; line-height:16px; } 
a.tooltip-reports:focus span{ text-align:left; display:inline; word-wrap: break-word; position:absolute; border:2px solid #FFF; color:#EEE; background:#000; width:270px; } 
.callout-reports { z-index:20; position:absolute; border:0; top:-14px; left:135px; } 
/*CSS3 extras*/ 
a.tooltip-reports span { border-radius:10px; -moz-border-radius: 2px; -webkit-border-radius: 2px; -moz-box-shadow: 0px 0px 8px 4px #666; -webkit-box-shadow: 0px 0px 8px 4px #666; box-shadow: 0px 0px 8px 4px #666; opacity: 0.95; }

1 个答案:

答案 0 :(得分:0)

查看:target选择器。 Mozilla has an example of doing basically what you want here.

:target是一个伪类,它使用通过哈希符号#链接到的任何内容的ID来设置目标元素的样式。

It is supported in the major browsers. It is not supported in IE8 (or below) and has partial support in IE9+.