A
A
Arthur2018-01-29 14:24:14
css
Arthur, 2018-01-29 14:24:14

Is it possible to wrap a block in a label?

Is it possible to wrap a div that contains a checkbox in a label?
so that when you click on the div, the state of the checkbox changes.
Code Example

<label for="option-one">
    <div class="order">
        <input type="checkbox" id="option-one">
    </div>
    <p>купить выгодно</p>
</label>

<label for="option-two">
    <div class="order">
        <input type="checkbox" id="option-two">
    </div>
    <p>купить выгодно</p>
</label>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2018-01-29
@tyzberd

you can, but it's better not to use a div, but a span with display:block
and for="option-one" in this case, you can not add

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question