gpt4 book ai didi

html - Pur input radio in circle with CSS radio customizing

转载 作者:行者123 更新时间:2023-11-28 01:36:56 29 4
gpt4 key购买 nike

早上好我想将输入 radio 放在这个圈子中,我找到了一个没有这个 css 的答案,但我需要用这个输入 radio 自定义 css 来做到这一点,就像这里一样。

我希望你能帮助我。

表格中的相同内容:为什么我不能将它们放入其中?

谢谢!安德鲁

这里是radio的css:

input[type="radio"] {
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
display: block;
float: left;
margin-right: -2rem;
opacity: 0;
width: 1rem;
z-index: -1; }
input[type="radio"] + label {
text-decoration: none;
cursor: pointer;
display: inline-block;
font-size: 1rem;
font-weight: 400;
padding-left: 2.825rem;
padding-right: 0.875rem;
position: relative; }
input[type="radio"] + label:before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-transform: none !important; }
input[type="radio"] + label:before {
border-radius: 4px;
border: solid 1px;
content: '';
display: inline-block;
height: 1rem;
left: 0;
line-height: 1.86875rem;
position: absolute;
text-align: center;
top: +0.25rem;
/*top: -0.1625rem;*/
width: 1rem; }
input[type="checkbox"]:checked + label:before,
/*input[type="radio"]:checked + label:before*/ {
content: '\f00c'; }

input[type="radio"] + label:before {
border-radius: 100%; }

::-webkit-input-placeholder {
opacity: 1.0; }

:-moz-placeholder {
opacity: 1.0; }

::-moz-placeholder {
opacity: 1.0; }

:-ms-input-placeholder {
opacity: 1.0; }

label {
color: #555555; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
select,
textarea {
background-color: rgba(0, 0, 0, 0.075);
border-color: rgba(0, 0, 0, 0.25); }
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
border-color: #ce1b28;
box-shadow: 0 0 0 1px #ce1b28; }

select {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'%3E%3Cpath d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='rgba(0, 0, 0, 0.25)' /%3E%3C/svg%3E"); }
select option {
color: #444444;
background-color: #ffffff; }

input[type="checkbox"] + label,
input[type="radio"] + label {
color: #444444; }
input[type="checkbox"] + label:before,
input[type="radio"] + label:before {
background: rgba(0, 0, 0, 0.075);
border-color: rgba(0, 0, 0, 0.25); }
input[type="radio"]:checked + label:before {
background-color: #ce1b28;
border-color: #ce1b28;
color: #ffffff; }
input[type="radio"]:focus + label:before {
border-color: #ce1b28;
box-shadow: 0 0 0 1px #ce1b28; }

::-webkit-input-placeholder {
color: #bbbbbb !important; }

:-moz-placeholder {
color: #bbbbbb !important; }

::-moz-placeholder {
color: #bbbbbb !important; }

:-ms-input-placeholder {
color: #bbbbbb !important; }
这是使用没有 css 的单选按钮的旧解决方案:

<div style="display:inline-block;position:relative">
<label style="position:absolute;top:55px;left:0;right:0;margin:auto;width:100%;display:inline-block" align="center"><input type="radio"/></label>
<svg height="334.4" width="334.4">
<circle cx="167.2" cy="167.2" r="134" stroke="#00ffff" stroke-width=4 fill="#e6ffff" />
<text text-anchor="middle" stroke="#000000" stroke-width="1px" dy=".3em">
<tspan x="50%" y="25%" dy="1.2em">Line 1</tspan>
</text>
<text text-anchor="middle" stroke="#000000" stroke-width="0.5px" dy=".3em">
<tspan x="50%" y="35%" dy="1.2em">Line 2</tspan>
<tspan x="50%" y="45%" dy="1.2em">Line 3</tspan>
<tspan x="50%" y="55%" dy="1.2em">Line 4</tspan>
<tspan x="50%" y="65%" dy="1.2em">Line 5</tspan>
<tspan x="50%" y="75%" dy="1.2em">Line 6</tspan>
</text>
</svg>
</div>

the example of unhidden radio. I would put only red.

最佳答案

input[type="radio"] 中删除 appearance: none 并将 opacity: 0 更改为 opacity : 1

请参阅显示 radio 的 fiddle :https://jsfiddle.net/e5bm16nd/1/

关于html - Pur input radio in circle with CSS radio customizing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50627625/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com