簡體   English   中英

如何在復選框左側添加標簽?

[英]How can I add a label left of a checkbox?

我有這個復選框: http : //jsfiddle.net/cdyjt4wo/

<div class="onoffswitch">
    <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch">
    <label class="onoffswitch-label" for="myonoffswitch">
        <span class="onoffswitch-inner"></span>
        <span class="onoffswitch-switch"></span>
    </label>
</div>

我想在復選框的左側添加標簽/跨度,例如“設置輸出”。 我試了很多 但是,沒有什么是對的。

提前致謝!

你是這個意思嗎

<div class="onoffswitch">
    <label class="onoffswitch-label" for="myonoffswitch">Label</label>
    <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch">

        <span class="onoffswitch-inner"></span>
        <span class="onoffswitch-switch"></span>

</div>

HTML將從左上方加載元素,除非您使用CSS設置其樣式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM