admin管理员组文章数量:1399978
This has to be a crazy basic question, but for the life of me I can't figure it out right now...
I have a <td class="hide">Some text</td>
I want only the TEXT/HTML inside of the <td>
to be hidden, NOT the entire <td>
itself. How can this be achieved with CSS??
jsFiddle Example
*Note
Applying a span inside it, etc isn't necessarily an option.
This has to be a crazy basic question, but for the life of me I can't figure it out right now...
I have a <td class="hide">Some text</td>
I want only the TEXT/HTML inside of the <td>
to be hidden, NOT the entire <td>
itself. How can this be achieved with CSS??
jsFiddle Example
*Note
Applying a span inside it, etc isn't necessarily an option.
Share Improve this question asked Jan 29, 2014 at 17:03 Mark Pieszak - Trilon.ioMark Pieszak - Trilon.io 67.3k15 gold badges83 silver badges96 bronze badges 1-
1
You can't do that if you don't want to wrap the text inside the
td
in a container... – damian Commented Jan 29, 2014 at 17:04
3 Answers
Reset to default 8Instead of
display: none;
You could try
text-indent: -9999px;
What about just making it transparent?
opacity: 0.0;
You can either do:
$('.hide').css('color','rgba(0,0,0,0)');//will make the text transparent and retain the width
or
$('.hide').text('');//will delete the text, not retaining the width
or:
$('.hide').wrap('<span style="opacity:0">');//will use a span and retain the width
JSFiddle
Hope this helps!
本文标签: javascriptHide Html inside of a lttdgt not the lttdgt itselfStack Overflow
版权声明:本文标题:javascript - Hide Html inside of a <td> not the <td> itself - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744241006a2596789.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论