It is necessary that the select
element occupies the entire width of the block and has indents margins margin: 10px 15px 0 15px;
.
The indented style does not work on the right; it is stretched to the full width of the global parent block that does not have indents. If you add this select to the div
with the necessary paddings, then everything works fine. But you can't do that, because It is dynamic and is created from the js function.
How to add margin
margins to a dynamic select and at the same time leave it independent of other elements?
<select> <option value="0">text</option> <option value="571">text</option> </select> select { width: 100%; height: 35px; margin: 10px 15px 0 15px; box-sizing: border-box; }
UPD
Mistaken in the style indicated in the question. But there is no error in the project. Styles are correct, but not working.