如何不显示值
How to not display the value
我正在使用 jscolor 通过输入选择颜色。
我想设计它的样式,但我无法摆脱所选颜色的十六进制值,而且我没有找到任何关于选项的文档。
我试过的:
//It shows nothing
display: none
//It works but then the dot isn't properly aligned
font-size:0
//does nothing
class="jscolor "{valueElement:null, value:"#e6e5f4"}
变化:
class="jscolor "{valueElement:null, value:"#e6e5f4"}
至:
class="jscolor {valueElement:null, value:'#e6e5f4'}"
更改 jscolor
class,像这样:
<br><div id="cb">
<ul class="list">
<li class="list__item">
<input id="CLR1" class="jscolor {valueElement:null, value:'#e6e5f4'}">
<label class="label--checkbox">
<input type="checkbox" class="checkbox" value="1">
Must stay approximately aligned
</label>
</li>
</ul>
</div>
由于输入错误,您的 class 未被应用。
选择以下更正之一:
<input id="CLR1" class="jscolor {valueElement:null, value:'#e6e5f4'}">
(首选)
<input id="CLR1" class='jscolor {valueElement:null, value:"#e6e5f4"}'>
⋅
⋅
⋅
然后,要使其正确对齐,您只需删除 .checkbox
元素上的 top
:
.checkbox {
position: relative;
/* top: -0.375rem; */
margin: 0 1rem 0 0;
cursor: pointer;
}
已更新 fiddle:https://jsfiddle.net/7ayLhLpc/
希望对您有所帮助!
我正在使用 jscolor 通过输入选择颜色。
我想设计它的样式,但我无法摆脱所选颜色的十六进制值,而且我没有找到任何关于选项的文档。
我试过的:
//It shows nothing
display: none
//It works but then the dot isn't properly aligned
font-size:0
//does nothing
class="jscolor "{valueElement:null, value:"#e6e5f4"}
变化:
class="jscolor "{valueElement:null, value:"#e6e5f4"}
至:
class="jscolor {valueElement:null, value:'#e6e5f4'}"
更改 jscolor
class,像这样:
<br><div id="cb">
<ul class="list">
<li class="list__item">
<input id="CLR1" class="jscolor {valueElement:null, value:'#e6e5f4'}">
<label class="label--checkbox">
<input type="checkbox" class="checkbox" value="1">
Must stay approximately aligned
</label>
</li>
</ul>
</div>
由于输入错误,您的 class 未被应用。
选择以下更正之一:
<input id="CLR1" class="jscolor {valueElement:null, value:'#e6e5f4'}">
(首选)
<input id="CLR1" class='jscolor {valueElement:null, value:"#e6e5f4"}'>
⋅ ⋅ ⋅
然后,要使其正确对齐,您只需删除 .checkbox
元素上的 top
:
.checkbox {
position: relative;
/* top: -0.375rem; */
margin: 0 1rem 0 0;
cursor: pointer;
}
已更新 fiddle:https://jsfiddle.net/7ayLhLpc/
希望对您有所帮助!