How to change disabled checkbox color - css

i want to override the semantic ui css for disabled checkbox, since i'm not good at css i don't which role i should override.
<link href="https://semantic-ui.com/dist/semantic.min.css" rel="stylesheet"/>
<div class="ui disabled checkbox">
<input type="checkbox" disabled="disabled">
<label>Disabled</label>
</div>
<div class="ui disabled checkbox">
<input type="checkbox" disabled="disabled">
<label></label>
</div>
From the snippet above it seems that they are styling the label. How can i set the box of checkbox color to something like grey or any darker color?

input[type="checkbox"]:disabled + label::before{
background: gray;
}
input[type="checkbox"]:disabled + label:hover::before{
background: gray;
border: 1px solid #d4d4d5;
}
<link href="https://semantic-ui.com/dist/semantic.min.css" rel="stylesheet" />
<div class="ui disabled checkbox">
<input type="checkbox" disabled="disabled">
<label>Disabled</label>
</div>
<br/>
<div class="ui disabled checkbox">
<input type="checkbox">
<label>Abled</label>
</div>

Related

<input> change color when it is correct

I have a problem with <input>. I want to check whether the user has filled it out or not.
By default, the input border will be gray. When the user did not fill in the fields it will have a red border otherwise green.
I added two CSS codes:
input:not(:focus):not(:placeholder-shown):invalid {
border-color: red;
}
input:not(:focus):not(:placeholder-shown):valid {
border-color: green;
}
In <input> where I added required, the border is red, and here where I don't have required, the border is green. Can I change it somehow?
These are default fields that are not required.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.3/dist/js/bootstrap.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<form name="companies" method="post" class="default_ajax was-validated" enctype="multipart/form-data">
<div class="input-field-group">
<input type="text" placeholder="Place #1" id="company_name" name="company_name" class="enable_character_count form-control" required>
<label class="company-label">Input 1</label>
</div>
<div class="input-field-group">
<input type="text" placeholder="Place #2" id="company_service_name_1" name="company_service_name_1" class="enable_character_count form-control"/>
<label class="company-label">Input 2 </label>
</div>
</form>

Issue with CSS coloring the inside of a radio

I am trying to color the inside of my radio button when its checked, so I have this html:
<div class="form-check">
<label>
<input
class="form-check-input"
type="radio"
name="myradio">
Text here
</label>
</div>
And this css:
.form-control-input:checked~.form-control-label::before {
color: #fff;
border-color: #7B1FA2;
}
The above css is not coloring it.
How can I do this?

Bootstrap 4 - Left aligning a large checkbox

Bootstrap 4.
<div class="form-group">
<label asp-for="Enabled" class="control-label"></label>
<input asp-for="Enabled" class="form-control" type="checkbox" />
<span asp-validation-for="Enabled" class="text-danger"></span>
</div>
I have a form (see image). I would like the check box to be underneath the word "Enabled" not centred like the other full width controls.
If I set "width: auto;" on the checkbox, this does the job, but then displays a small checkbox (I want a large one). See image.
<div class="form-group">
<label asp-for="Enabled" class="control-label"></label>
<input asp-for="Enabled" class="form-control" style="width: auto;" type="checkbox" />
<span asp-validation-for="Enabled" class="text-danger"></span>
</div>
My question is, how can I get a large left aligned checkbox on my form?
I am also searched before for the same issue, but not satisfied with the above answer that's why I have done my research and I found a good solution. Just add class "col-sm-1"
in the input tag, you are done.
<div class="col-8">
<input asp-for="IsUrgent" type="checkbox" class="form-control col-sm-1" />
<span asp-validation-for="IsUrgent" class="text-danger" />
</div>
you can also use like this if you are not satisfying with class name
input[type="checkbox"]{
width: 30px; /*Desired width*/
height: 30px; /*Desired height*/
cursor: pointer;
-webkit-appearance: none; /* if you want check inside box then remove this line*/
appearance: none; /* if you want check inside box then remove this line*/
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<form>
<div class="form-group">
<label asp-for="Enabled" class="control-label">Enabled</label>
<input asp-for="Enabled" class="form-control checkbox-large" type="checkbox" />
<span asp-validation-for="Enabled" class="text-danger"></span>
</div>
</form>
Its not tidy by setting an height and width for the checkbox should do the trick.
.checkbox-large {
width: 25px !important;
height: 25px
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<form>
<div class="form-group">
<label asp-for="Enabled" class="control-label">Enabled</label>
<input asp-for="Enabled" class="form-control checkbox-large" type="checkbox" />
<span asp-validation-for="Enabled" class="text-danger"></span>
</div>
</form>

Align Check Boxes CSS

I want to align some check boxes with labels such that the check boxes are in a vertical row to the right side and the labels are aligned with the starting edges in a vertical row on the left side.
.row {
display: flex;
}
.row label { flex: 1; max-width: 25%; }
<div class="container">
<div class="row">
<label>Label</label><input type="checkbox" />
</div>
<div class="row">
<label>Label 2</label><input type="checkbox" />
</div>
<div class="row">
<label>Label 3</label><input type="checkbox" />
</div>
</div>
I believe this is what you're looking for:
label {
display: inline-block;
padding-left: 15px;
}
<form>
<div>
<label>Label text</label><input type="checkbox" />
<label>Label text</label><input type="checkbox" />
<label>Label text</label><input type="checkbox" />
</div>
<form>
Working Example: JSFiddle
Css File:
.badgebox
{
opacity: 0;
}
.badgebox + .badge
{
/* Move the check mark away when unchecked */
text-indent: -999999px;
/* Makes the badge's width stay the same checked and unchecked */
width: 27px;
}
.badgebox:focus + .badge
{
/* Set something to make the badge looks focused */
/* This really depends on the application, in my case it was: */
/* Adding a light border */
box-shadow: inset 0px 0px 5px;
/* Taking the difference out of the padding */
}
.badgebox:checked + .badge
{
/* Move the check mark back when checked */
text-indent: 0;
}
HTML File:
<div class="container">
<div class="row text-center">
<br>
<br>
<h1>Badgebox: CSS only checkbox badge!</h1>
<h2>Works on Bootstrap 2.3.2 and up</h2>
<br>
<label for="default" class="btn btn-default">Default <input type="checkbox" id="default" class="badgebox"><span class="badge">&check;</span></label>
<label for="primary" class="btn btn-primary">Primary <input type="checkbox" id="primary" class="badgebox"><span class="badge">&check;</span></label>
<label for="info" class="btn btn-info">Info <input type="checkbox" id="info" class="badgebox"><span class="badge">&check;</span></label>
<label for="success" class="btn btn-success">Success <input type="checkbox" id="success" class="badgebox"><span class="badge">&check;</span></label>
<label for="warning" class="btn btn-warning">Warning <input type="checkbox" id="warning" class="badgebox"><span class="badge">&check;</span></label>
<label for="danger" class="btn btn-danger">Danger <input type="checkbox" id="danger" class="badgebox"><span class="badge">&check;</span></label>
</div>
</div>
Or
Refer this Link:
https://bootsnipp.com/snippets/featured/badgebox-css-checkbox-badge

How do I change the Mailchimp subscribe button color using inline CSS?

How can I use inline css to change the button and hover colors in the embedded Mailchimp form on my site Homeschool With Love? I would like the background color to be #0A99AA and the hover color to be #d40000. It is a Wordpress.org site. Can you please show what code I should insert and where I should insert it? Thanks. Here's the code I have right now:
<div style="border-style: solid; border-width: 2px; border-color: #0A99AA;">
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="//homeschoolwithlove.us13.list-manage.com/subscribe/post?u=74d56fdb848e8be499cc4df0e&id=a119f30caa" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<div style="text-align: center; color: #d40000; font-size: 120%; padding-right: 10px; padding-left: 10 px;">
<h3>Sign up for the Homeschool With Love Newsletter and get the Angel Learning Resource Pack FREE</h3>
</div>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group">
<label for="mce-FNAME">First Name <span class="asterisk">*</span>
</label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-LNAME">Last Name </label>
<input type="text" value="" name="LNAME" class="" id="mce-LNAME">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none">
</div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<input type="text" name="b_74d56fdb848e8be499cc4df0e_a119f30caa" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
</div>
add these two lines immediately after the #mc_embed_signup line:
#mc-embedded-subscribe { background-color: #0a99a !important; }
#mc-embedded-subscribe:hover { background-color: #d40000 !important; }

Resources