100% width on the checkboxes makes center alignment. How can I resist this?

I set all input to 100% width using CSS. However, for some reason, the flags are centered. Anyway, to counter this? I do not want to use attribute selection via css, as they are not fully supported.

+3
source share
3 answers

You need to set the width back to auto ( width: auto).

If you do not want to use the attribute selector, then you must find another selector that matches the checkboxes. This may include the addition of additional markup (such as a class).

+4
source

:

<div class="checkbox">
    <input type="checkbox" value="check-value">Human readable value
</div>

CSS:

.checkbox {
    width: 100%;
    text-align: left;
}
+1

input.checkbox 
{ 
    text-align: left; 
    margin: 0 auto;
}
0

Source: https://habr.com/ru/post/1743694/


All Articles