-1

I have 2 HTML buttons that I want to be side by side on the same line with the first (Submit Request(s)) button to be first. The problem that I am having is that the top of the second button starts where the bottom of the bottom button ends. The second button is correctly moved to the right because of the margin-left: 50px element. I have listed the HTML of the 2 buttons below:

<button style="float: left;" onclick="javascript:submitRequests();">
    Submit Request(s)
</button>
<button style="float: left; margin-left: 50px" 
        onclick="javascript:document.location.reload(true);">
    Reset
</button>
Maehler
  • 6,111
  • 1
  • 41
  • 46
John Mitchell
  • 271
  • 4
  • 13

3 Answers3

1

try before use a Codepen or JsFiddle to add your code or idea.

I'm suggest you to see my porpose to this solution: http://cdpn.io/uKLga

You see it be simple you just add 2 class and define this buttons types (submit and reset) with these classes help you to format side by site.

Rick Benetti
  • 13,137
  • 2
  • 12
  • 6
0

This should do the trick: http://jsfiddle.net/cau4t/

<div class="container">
    <button onclick="javascript:submitRequests();">Submit Request(s)</button>
    <button onclick="javascript:document.location.reload(true);">Reset</button>
</div>

.container {
    overflow: hidden;
}

button {
    float: left;
}

button:first-child {
    margin-right: 50px;
}
Billy Moat
  • 20,792
  • 7
  • 45
  • 37
0

As it turned out all I had to do was get rid of the spaces between the 2 buttons and now they are no longer offset. This was within a Drupal webform which seems to be picky about the extra spaces.

John Mitchell
  • 271
  • 4
  • 13