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
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.
thanks bud
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?
Add all CSS classes and styling to your CSS file. Any manipulation you want to make dynamically should be done through your javascript.
1 Like