I have a flask form,
<form action="/data1" method="GET">
<button type="submit">Feed1</button>
</form>
<form action="/data2" method="GET">
<button type="submit">Feed2</button>
</form>
Button is displayed as below,
Expectation is to add the buttons in a same row.
Tried below style, but its not helping,
button {
background-color: #4CAF50;
border: none;
color: white;
padding: 5px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
Any suggestion will be appreciated.
Not sure if is its because of Form tag, it is not getting aligned. I have tried wrapper class as well, but no response.
2
Answers
You can align the buttons in a row using CSS flexbox. Just add a parent container with the
display: flex
property, and setjustify-content: center
to center the buttons horizontally.Example:
HTML:
CSS:
Hope it helps 🙂
You can do this. Set the
display
property of your buttons toinline-flex
and your classrow
with adisplay
offlex
. Here is a working snippet of what you need to do.