问题
I'm trying to display some data using pre
tag. Sometimes it won't get any data from the wicket. In that case, it should not show anything on the page. Instead, it is displaying a blank line. Please help on how to prevent the blank line from the page. And I'm sure it is producing because of pre
tag
<div>
<a wicket:id="Data" class="text-white">Click to View</a>
<pre wicket:id="Label" class="text-white bg-dark"></pre>
</div>
回答1:
on Wicket side you can make the component invisible if its model is empty, but maybe you can solve this with a little css:
pre:empty {
display: none;
}
来源:https://stackoverflow.com/questions/57886269/pre-tag-giving-blank-line-if-no-data-sent-from-wicket