我正在寻找如下使用html的输出
创意机构:(?)*
我正在写下面这样的代码……
<td class="TextLabelForHeader" width="300px">
Creative Agency:<h6 id="/contracts/HelpContent/Creative%20Agency.txt">()</h6>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorCreativeAgency" runat="server"
ControlToValidate="txtCreativeAgency" ErrorMessage="*" ValidationGroup="VGPageGeneral">
</asp:RequiredFieldValidator>
</td>但是我在broswer中得到了类似下面的输出...
创意机构:(?) *
有没有人能帮我一下……
谢谢
发布于 2012-10-26 05:26:52
标头标签,如H6,是块元素。块元素占据了其容器的整个宽度。
以下任一项:
使用CSS:h6 {display:inline};使H6成为内联元素
或
为此,请使用语义正确的HTML元素,在本例中为<label>。
发布于 2012-10-26 05:39:43
您也可以使用内联元素替换您的h6,例如<span>
Creative Agency:<span style="font-weight:bold; font-size:14pt" id="/contracts/HelpContent/Creative%20Agency.txt">()</span>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorCreativeAgency" runat="server"
ControlToValidate="txtCreativeAgency" ErrorMessage="*" ValidationGroup="VGPageGeneral">h1..h6是块元素,它们占用容器的所有可用空间,迫使容器中的其他元素转到下一行。
如果我可以问一下,为什么你的h6上有这么有趣的id?
https://stackoverflow.com/questions/13077505
复制相似问题