我已经尝试过了,但只有没有下划线的空白跨度
<h:outputText style="font-weight:bold;text-decoration:underline" rendered="#
{declarationBB.deaclarationOpr.declarationDetailsobj.productName == null}" value=" " />
我已经尝试过了,但只有没有下划线的空白跨度
<h:outputText style="font-weight:bold;text-decoration:underline" rendered="#
{declarationBB.deaclarationOpr.declarationDetailsobj.productName == null}" value=" " />
HTML 中无关紧要的空白将被折叠。除非您在开头和结尾插入非空白字符,否则您实际上最终没有视觉表示,如下所示:
value="[ ]"
如果您想要的只是一条固定大小的线,请使用一堆下划线:
__________________________
或者,如果您真的想为此使用 HTML/CSS,请使用固定宽度和边框底部的块元素:
<div style="width: 200px; border-bottom: 1px solid black;"></div>
<hr>
但是,如果您真正想要的是“水平规则”,则A在语义上更正确:
<hr style="margin: 0; width: 200px; height: 1px; background: black; border: none;" />
应该注意的是,您应该尽可能避免使用style
并使用class
/styleClass
来代替。