AndrewVos AndrewVos - 3 months ago 8
CSS Question

Make a bootstrap form, containing a button, appear inline next to another button

I want to move the "Delete page" button up next to the "View page" button. Is there an easy way to do this in bootstrap?

I don't want to wrap the h1 and "View page" button in the form, to preserve html readability.

<h1>
Edit page
<a target="_blank" class="btn btn-default" href="/view">View page</a>
<form role="form">
<input type="submit" name="commit" value="Delete page" class="btn btn-danger btn btn-primary" data-confirm="Are you sure?" />
</form>
</h1>


enter image description here

Answer

add display: inline to your form :

form{
  display: inline;
}

https://jsfiddle.net/ypkLaexL/