Pre tag giving blank line if no data sent from wicket

混江龙づ霸主 提交于 2019-12-11 16:24:36

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!