I have HTML code here down below and there is text which does not have any HTML surrounding. Is there any method to hide the text "Enter" which is after "p" tag?
<div class="entry">
<p class="page-header" style="text-align: center;"><strong>Enter</strong></p>
<p> </p>
Enter <-- i want to hide this text
<div class="subhead"></div>
</div>
It is not possible to wrap it with a div or any other tag, so I need some different decision like JavaScript or some CSS?
Style display property is used to hide and show the content of HTML DOM by accessing the DOM element using JavaScript/jQuery. To hide an element, set the style display property to “none”. document.
The following style rule hides an element on a web page: display: none; When you set the value of display to none, the affected element will disappear. This means the element will no longer take up any space on the web page.
A few tags are called non-container tags, because they don't contain any content - they stand alone. Examples are images and line breaks.
<cite> and <q>
I would consider a CSS hack with font-size:
.entry {
font-size:0;
}
.entry * {
font-size:initial;
}
<div class="entry">
<p class="page-header" style="text-align: center;"><strong>Enter</strong></p>
<p> somethin here</p>
Enter (this will be hidden !!)
<div class="subhead">another text here</div>
</div>
Another idea with visibility
:
.entry {
visibility:hidden;
}
.entry * {
visibility:visible;
}
<div class="entry">
<p class="page-header" style="text-align: center;"><strong>Enter</strong></p>
<p> somethin here</p>
Enter (this will be hidden !!)
<div class="subhead">another text here</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With