@viktorross

Почему не работает checkbox?

Здравствуйте, подскажите пожалуйста почему не работает checkbox, пытался стилизовать , но ничего не меняется, вот код, что тут не так?

<div class="option_right"><input type="checkbox" id="noborders" class="noborders" name="featured" onclick="adjustTotal(this.form, {$ads_settings.featured_price}, document.newad.featured, {$appearance.price_format_decimals} )" {if $featured}checked="checked" disabled="disabled"{/if}/><label for="noborders"></label>&nbsp;{if $appearance.currency_pos==0}{$appearance.default_currency}{/if}{$ads_settings.featured_price_formatted}{if $appearance.currency_pos==1}{$appearance.default_currency}{/if}&nbsp;


.noborders input[type="checkbox"]:checked, 
.noborders input[type="checkbox"]:not(:checked)
	
	{
    position: absolute;
    left: -9999px;
}

.noborders input[type="checkbox"]:checked + label, 
.noborders input[type="checkbox"]:not(:checked) + label {
	 display: inline-block;
    position: relative;
    padding-left: 28px;
    line-height: 20px;
    cursor: pointer;
}


.noborders input[type="checkbox"] + label {
    padding-left: 28px;
    background-size: 20px 20px;
    background-position: 0 2px;
}

.noborders input[type="checkbox"]:checked + label {
     background-image: url(../s/check-active.svg);
}

.noborders input[type="checkbox"]:checked + label:before, 
.noborders input[type="checkbox"]:not(:checked) + label:before,

{
	content: "";
    position: absolute;
    left: 0px;
    top: 0px;
    width: 18px;
    height: 18px;
    border: 1px solid #dddddd;
    background-color: #ffffff;
}

.noborders input[type="checkbox"]:checked + label:after, 
.noborders input[type="checkbox"]:not(:checked) + label:after, 
{
content: "";
    position: absolute;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.noborders input[type="checkbox"]:checked + label:after, 
.noborders input[type="checkbox"]:not(:checked) + label:after {
    left: 3px;
    top: 4px;
    width: 10px;
    height: 5px;
    border-radius: 1px;
    border-left: 4px solid #e145a3;
    border-bottom: 4px solid #e145a3;
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    transform: rotate(-45deg);
}

.noborders input[type="radio"]:checked + label:after, 
.noborders input[type="radio"]:not(:checked) + label:after {
    left: 5px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 100%;
    background-color: #e145a3;
}

.noborders input[type="checkbox"]:not(:checked) + label:after
{
    opacity: 0;
}

.noborders input[type="checkbox"]:checked + label:after
{
    opacity: 1;
}
  • Вопрос задан
  • 1478 просмотров
Решения вопроса 1
alexey-m-ukolov
@alexey-m-ukolov Куратор тега CSS
В css у вас инпут должен быть вложен в .noborders, а в разметке он сам и имеет этот класс.
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы