相关疑难解决方法(0)

如何使用CSS设置复选框的样式?

我正在尝试使用以下方式设置复选框的样式:

<input type="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;" />
Run Code Online (Sandbox Code Playgroud)

但风格并未适用.该复选框仍显示其默认样式.我如何给它指定的样式?

html css checkbox

788
推荐指数
21
解决办法
158万
查看次数

更改Bootstrap 4复选框大小

有没有办法将Bootstraps 4 beta复选框大小更改为更大的?

我几乎尝试改变风格,但这不起作用.

谢谢!

bootstrap-4

19
推荐指数
4
解决办法
3万
查看次数

复选框 CSS 无法更改复选框的背景颜色

我想将我的复选框更改为这种颜色#FA9E57。我正在使用 bootstrap v 4.6。

这是我的复选框代码:

input[type=checkbox]{
    width: 20px;
    height: 20px;
    background-color: #FA9E57;
}

input[type=checkbox]:checked{
    background-color: #FA9E57;
}
Run Code Online (Sandbox Code Playgroud)
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="register.css">
    <title><%=judul %></title>
    
    <body>
    <div class="form-group my-4">
       <div class="form-check">
         <input class="form-check-input" type="checkbox" id="privacy">
         <label class="form-check-label ml-3" for="privacy">
          Agree privacy
         </label>
       </div>
    </div>
    </body>
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap bootstrap-4

16
推荐指数
2
解决办法
6万
查看次数

如何更改此 Bootstrap 4 切换开关的“选中”背景颜色?

我不知道如何更改此 Bootstrap 4 切换开关的“选中”背景颜色。它使用额外的库来切换深色和浅色模式 \xe2\x80\x93 Here on github \xe2\x80\x93 但这是有效的。我想要做的就是更改活动复选框的背景颜色,默认情况下为蓝色。Bootstrap CSS 默认为蓝色吗?这个答案更改 Bootstrap 4 复选框背景颜色对我不起作用;它更改了未选中的颜色,但我无法从中 grep 如何更改选中的颜色。

\n

在这里摆弄

\n

我的代码在这里:

\n

\r\n
\r\n
.custom-control-input {\n  background-color: red;\n}
Run Code Online (Sandbox Code Playgroud)\r\n
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">\n<div class="custom-control custom-switch">\n  <input type="checkbox" class="custom-control-input" id="darkSwitch" />\n  <label class="custom-control-label" for="darkSwitch">Dark Mode</label>\n</div>
Run Code Online (Sandbox Code Playgroud)\r\n
\r\n
\r\n

\n

css checkbox bootstrap-4

11
推荐指数
2
解决办法
2万
查看次数

标签 统计

bootstrap-4 ×3

css ×3

checkbox ×2

html ×2

twitter-bootstrap ×1