Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 复选框赢得';t转到asp:Label的右侧_Asp.net - Fatal编程技术网

Asp.net 复选框赢得';t转到asp:Label的右侧

Asp.net 复选框赢得';t转到asp:Label的右侧,asp.net,Asp.net,我有一个包含asp:标签和asp:复选框的div 我试着把标签放在复选框的左边,但它就是不在这里。 我想把这两个都放在这一页的右边 <div> <asp:Label runat="server" style="float:right;" > Conclude Case File</asp:Label> <input type="checkbox" class="concludeCBox" id="concludeNoteC

我有一个包含asp:标签和asp:复选框的div 我试着把标签放在复选框的左边,但它就是不在这里。 我想把这两个都放在这一页的右边

<div>
    <asp:Label runat="server" style="float:right;" >
        Conclude Case File</asp:Label>
    <input type="checkbox" class="concludeCBox" id="concludeNoteCBox" runat="server"
        style="float:right;" />
</div>

结案

asp:标签呈现为跨度。asp:复选框作为输入呈现。SPAN和INPUT都不是块元素,因此float不适用。我的建议是定义CSS类,将它们更改为BLOCK,然后根据需要定位它们

还请记住,当您浮动时:正确的东西显示为“向后”渲染。也就是说,第一个浮动的右元素将最右,依此类推。因此,如果您首先选中复选框,请将其放在标记中的第一位。


<div style="float:right;">
    <asp:Label runat="server" style="float:left;padding-right:10px;" >
        Conclude Case File</asp:Label>
    <input type="checkbox" class="concludeCBox" id="concludeNoteCBox" 
        runat="server" style="float:left;" />
</div>

我希望两个控件都在页面的右侧啊,看,我不知道为什么我不想把我现在觉得很傻。。。谢谢,这比较干净。没有想到我们“在里面”