MUI框架中的switch組件顯示文字是英文(ON/OFF),本文的主要目的有兩個:一是將英文改爲中文,二是指定switch組件自定義文字。css
<div class="mui-input-row">
<label>語言</label>
<div id="lang" class="mui-switch mui-active">
<div class="mui-switch-handle"></div>
</div>
</div>
<div class="mui-input-row">
<label>音樂</label>
<div id="music_on" class="mui-switch">
<div class="mui-switch-handle"></div>
</div>
</div>
Ⅰ class選擇器通用寫法:html
.mui-switch.mui-active:before{content: '開';}
.mui-switch:before{content: '關';}
Ⅱ id選擇器指定元素寫法markdown
#lang.mui-switch.mui-active:before{content: '中文';}
#lang.mui-switch:before{content: '英文';}
【轉載請註明出處: http://blog.csdn.net/leytton/article/details/79837666】
PS:若是本文對您有幫助,請點個贊讓我知道哦~微笑app