I have a project with bootstrap and I do not know how to add a new style of checkbox.
I have already downloaded the files, but I do not know where to add them to the project or how to use the styles. It's in Visual studio Asp.Net
I have a project with bootstrap and I do not know how to add a new style of checkbox.
I have already downloaded the files, but I do not know where to add them to the project or how to use the styles. It's in Visual studio Asp.Net
Make sure you call your styles after calling the Bootstrap styles so that the styles you try to modify are overwritten
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<!-- Tema opcional -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap-theme.min.css">
<!-- Mi hoja de estilos -->
<link rel="stylesheet" href="style.css">
If you put it on the contrary it will seem that your styles are not being applied, but it's just that Bootstrap's are overwriting yours
In addition to the previous answers, I recommend a toggle to make it look better graphically.
Here is an example (also in jsfiddle ):
<!-- Toggle Switch -->
<link href="https://cdn.jsdelivr.net/css-toggle-switch/latest/toggle-switch.css" rel="stylesheet" />
<!-- HTML -->
<label class="switch-light switch-candy">
<input type="checkbox">
<strong>
Checkbox
</strong>
<span>
<span>Apagado</span>
<span>Encendido</span>
<a></a>
</span>
</label>
You must copy the files in the Content
folder, if it is an MVC project, to use them you must include them in the _Layout
view so that they are available in all the pages that use that Layout
, if only you occupy the style in some pages, but it is best to add them only in these.
To use a style the most secilla way is with the tag
<link rel="stylesheet" href="ruta/al/styles.css">
If the style consists of several files, it is best to do a bundle On Youtube there are several tutorials on the subject, you could see this