开发者

hide text in table cell(both button and text) when button inside table cell gets focus

in my application i have table cell loaded with button and text. now my question is how do i hide text when button receives focus.is that possible to write same text on to开发者_运维知识库p of image.

here is my demo


You can not solve this problem with CSS alone in case of "focus", since the text (you were talking about the "help", right?) is not a child element of your button. I'd suggest to use JS for this or move the text/image inside of the button.

<button><span>Help</span></button>

Then you could use CSS to hide the text when the button like this:

button:focus span { display: none; }

But I'm not sure if that still does what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜