Content centering is removed when button is pressed

Content centering is removed when button is pressed
0

#1

i have looked through the code and i dont know what i am not seeing, please advise
when i click the button to toggle div visibility then my centering goes weird


#2

To begin fixing this issue I would start moving all of your styling from your HTML to your CSS file. This makes editing and keeping track of your styles much easier. What is most likely happening is that when you click the button to change the content of the divs, you are taking away the styles that you hard coded into your HTML file.


#3

thanks bud :grinning:
i will move the styling to CSS.

i also use w3.css classes for styling.
which is cleaner, adding the classes in the JS or in the HTML?


#4

Add all CSS classes and styling to your CSS file. Any manipulation you want to make dynamically should be done through your javascript.