Asp.net mvc ZURB基金会5交换机不工作 我用的是演示代码,我在5.5.3 CSS版本中找到了 <div class="switch"> <input id="exampleCheckboxSwitch" type="checkbox"> <label for="exampleCheckboxSwitch"></label> </div>

Asp.net mvc ZURB基金会5交换机不工作 我用的是演示代码,我在5.5.3 CSS版本中找到了 <div class="switch"> <input id="exampleCheckboxSwitch" type="checkbox"> <label for="exampleCheckboxSwitch"></label> </div>,asp.net-mvc,zurb-foundation,Asp.net Mvc,Zurb Foundation,结果是: 注意,第二个是从基础4中使用的代码,它仍然或多或少地工作(“on”文本不显示) 不 是的 不知道发生了什么,在文档中它说不需要JavaScript,交换机的CSS存在于基础.CSS文件 < p>示例5中的示例是不正确的,因为不显示标签。我搜索示例并找到这个示例 <div class="onoffswitch"> <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="m

结果是:

注意,第二个是从基础4中使用的代码,它仍然或多或少地工作(“on”文本不显示)


不
是的

不知道发生了什么,在文档中它说不需要JavaScript,交换机的CSS存在于基础.CSS文件

< p>示例5中的示例是不正确的,因为不显示标签。我搜索示例并找到这个示例

<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>
<label class="onoffswitch-label" for="myonoffswitch">
    <span class="onoffswitch-inner"></span>
    <span class="onoffswitch-switch"></span>
</label>
这个例子在


对不起,对于我的英语:,但是是这个想法。

试用基金会的最新版本。这是我的手机,开关工作正常

<body>
    <div class="row">
        <div class="small-12 columns">
            <div class="switch">
                <input id="exampleCheckboxSwitch" type="checkbox">
                <label for="exampleCheckboxSwitch"></label>
            </div>            
        </div>
    </div>
</body>


请注意,我使用的是最新的。

尝试了一个快速的JSFIDLE,结果相同,但是我在文档站点的页面底部看到了这样的结果:“Sass错误?如果默认的“foundation”导入被注释掉,那么请确保导入此文件:@import“foundation/components/Switchs”;“我也看到了这个,默认的“foundation”默认情况下,“导入”使用每个组件。您可以对其进行注释并单独导入组件。但是,这只涉及Sass版本,因此与我无关。干杯汉克斯:)我希望他们是一个简单的方式来显示一个标签旁边的开关。。。现在很痛苦。。。
.onoffswitch {
position: relative; width: 90px;
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch-checkbox {
display: none;
}
.onoffswitch-label {
display: block; overflow: hidden; cursor: pointer;
border: 2px solid #999999; border-radius: 20px;
}
.onoffswitch-inner {
display: block; width: 200%; margin-left: -100%;
-moz-transition: margin 0.3s ease-in 0s; -webkit-transition: margin 0.3s ease-in 0s;
-o-transition: margin 0.3s ease-in 0s; transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
.onoffswitch-inner:before {
content: "ON";
padding-left: 10px;
background-color: #34A7C1; color: #FFFFFF;
}
.onoffswitch-inner:after {
content: "OFF";
padding-right: 10px;
background-color: #EEEEEE; color: #999999;
text-align: right;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
margin-left: 0;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
right: 0px; 
}
<body>
    <div class="row">
        <div class="small-12 columns">
            <div class="switch">
                <input id="exampleCheckboxSwitch" type="checkbox">
                <label for="exampleCheckboxSwitch"></label>
            </div>            
        </div>
    </div>
</body>