How to make the position of the element always in the same place?
Hello everyone ! Please tell me when you click on the picture (made a red border), the element is displayed, everything is fine, but when the screen is redrawn, this element flies away, how to fix it at one point (for example, under the picture)
Position through absolute. Place the drop-down menu and the button calling this menu inside one block.
You need to unify everything. You have a lot of code duplication.
For each button that changes the text style, you can add a js-control class and add data-attributes
data-property - the name of the property that will change and data-value - the value that will be substituted.
Those. you find all the elements with the js-control class, hang one click handler on them, after the click, the property that must change (property = data-propety) and the value that must be changed (value = data-value) are defined and apply them
textContent.style [property] = value;Audrey Cervantes
To place the code, please use CodePen or similar tool. Thanks you!