When switching from one div to another the elements are jumpy why?

is this the behaviour of div elements by default, when converted to button doesn't seem to have similiar issue why? and how to solve this jumpy issue when using div and would like to know why it might occuring be this way?
2 Replies
Chris Bolson
Chris Bolson4d ago
You are adding a 2px border on hover. With the div, there is no default border so the DOM has to "adjust" to make room for the border that you add on hover - this is what causes the jumping. Buttons, however, by default, do have a border so in this case it is just changing the color so you don't get the jumping. If you add a 2px transparent border to your div you should see that the there is no "jumping" when you add the hover effect.
angell1389
angell13894d ago
Amazing, thanks for that. What are the some of the default properities that exist in html elements Could u point me to documentation. never mind I can see it using in the browser debugger tools
Want results from more Discord servers?
Add your server
More Posts