Jump to content

Fix spacing between buttons/inputs on HTML

Go to solution Solved by mariushm,

Each browser has some pre-defined rules when it comes to margins and paddings.

You can try resetting them to known values by using the * in the css file :

 

* {
  margin: 0px;
  padding: 0px;
}

 

Hi, so I am trying to figure out how to fix the spacing between a few HTML inputs/buttons on my site, to see what im talking about you can visit my site at: https://searchly.xyz Basically, the 'search' button is way too close to the dropdown selector, and im trying to make the spacing seem less weird and more equal between the text input box, the dropdown selector and the 'search' button. If anyone knows how to do this, that would be great! I will attach the HTML code for the page below as well.

Code has been removed as issue is now solved.

 

Link to comment
https://linustechtips.com/topic/1087895-fix-spacing-between-buttonsinputs-on-html/
Share on other sites

Link to post
Share on other sites

add a css rule ... use margin-left or padding-left

or use make the div that has the button a certain width and add text-align right so that the button inside the div is aligned to the right side of the div therefore there's more space between buttons.

 

Link to post
Share on other sites

12 minutes ago, mariushm said:

add a css rule ... use margin-left or padding-left

or use make the div that has the button a certain width and add text-align right so that the button inside the div is aligned to the right side of the div therefore there's more space between buttons.

 

Thanks, I will try some of that. But I actually discovered something pretty odd, when I view the same page on Edge, it looks perfectly fine and the spacing is fixed without any changes to the original code. However on Firefox it has the issues with spacing. I cant really figure out why a page with the exact same code would appear slightly different on different browsers, but oh well..

Link to post
Share on other sites

3 minutes ago, mariushm said:

Each browser has some pre-defined rules when it comes to margins and paddings.

You can try resetting them to known values by using the * in the css file :

 


* {
  margin: 0px;
  padding: 0px;
}

 

That fixed it on firefox, thanks so much!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×