繁体   English   中英

如何隐藏文字并在点击时显示

[英]How to to hide text and show on click

我有一个深色分隔框,当您在div上单击并按住鼠标时,我想开发这样的东西。一个圆形div将透明,并且它将在该深色div下显示隐藏的句子。

给该div框一个类,例如darkBox,然后在css中,您还可以为单击border-radius提供“ active”属性,以使其变为圆形;如果您给其50%的值,则将其变为圆形;如果您希望拐角边缘为圆形或弯曲,则可以给出小于此的值

.darkBox:hover{
background-color: transparent;
border-radius: 50%;
}

希望对您有所帮助,如果不能,请告诉我您的确切要求

关键点:

 .orb { font-size: 3em; border: 2px solid black; border-radius: 50%; height: 1.5em; width: 1.5em; text-align: center; cursor: pointer; background-color: black; } .orb:before { content: '\\2620'; transition: opacity 3.5s ease-in, color 4s linear; opacity: 0; color: transparent; } .orb:hover:before { content: '\\2620'; opacity: 1; color: white; } .cap:after { content: ''; transition: opacity 3.5s ease-in, color 4s linear; opacity: 0; color: transparent; } .orb:hover .cap:after { content: 'The skull and crossbones is actually a font character'; opacity: 1; color: red; font: 400 16px/.3 'Palatino Linotype'; white-space: nowrap; } 
 <figure class="orb"> <figcaption class="cap"></figcaption> </figure> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM