2015-08-15 42 views
0

我有这个复选框: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> 

我想添加一个标签/ SPAN留下的复选框,例如“设置输出”。 我尝试了很多。但没有什么是正确的。

在此先感谢!

回答

1

你的意思是这样吗?

<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设计样式。

+0

是这样的。但标签不在上面。我怎样才能使用CSS来设计它? –

+0

http://jsfiddle.net/z58zzu6z/检查这个小提琴,它在你的左边吗? –

+0

是的。但是我怎样才能从CSS实现样式?我试过了,但标签总是在上面。 –

相关问题