Skip to content
Advertisement

Using Javascript to block element send to next line [closed]

I have a button element that is hidden at the beginning.

However, I have to display it on certain trigger using JavaScript. But when its triggered it gets pushed to next line. See the Image below :-

enter image description here

What I actually want is :-

enter image description here

Here is my Html code:-

JavaScript

and my JavaScript code which push it to next line:-

JavaScript

What is messing it up please explain and how can I fix this issue.

Advertisement

Answer

display: block will start on a new line and will take up the full width available. Use display: inline-block or display: inline instead.

Using display: block

JavaScript

Using display: inline-block

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement