K
K
kappka2015-10-09 12:48:52
css
kappka, 2015-10-09 12:48:52

How to style a checkbox like this?

There is this code:

<label class="a-item">
  <span class="a-item-box">
       <input type="checkbox" value="1440" class="chAccess" data-value="">
  </span>
  <span class="a-item-title"> Какой-то текст </span><br>
       <span class="a-item-price"> Цена </span>
</label>

How to style checkboxes in this case?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey B., 2015-10-09
@andykov

No way on CSS, just take out input from a-item-box
Or make another span inside a-item-box

A
Alexander Zubarev, 2015-10-09
@zualex

You need to attach a label to the checkbox. You hide the checkbox itself, but you style the label as you like.

<input type="checkbox" value="1440" class="chAccess" data-value="" id="check1">
<label for="check1"></label>

#check1{
    position: absolute;
    margin-left: -9999px;
    visibility: hidden;
}
label{
    /* Твои стили */
}

A
Alexander, 2015-10-09
@xa3apg

I agree with Andrey, for example, I often use such checkboxes myself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question