这是一个基本的表单代码
<form class="ui form" style="width: 30%;">
<div class="field">
<label>用户名</label>
<input type="text" name="username" placeholder="用户名">
</div>
<div class="field">
<label>密码</label>
<input type="password" name="password" placeholder="密码">
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" tabindex="0" class="hidden">
<label>我同意本条款和条件</label>
</div>
</div>
<button class="ui button" type="submit">提交</button>
</form>
在浏览器中渲染出来的页面应该是这样的:
但是如果想要复选框可以被选中,还需要添加jQuery语句
<script>
$('.ui.checkbox').checkbox(); //使得单选框可以被选中
</script>
最后可以得到结果