1

I am trying to align 3 buttons in a row but so far nothing has worked. I have emptied my CSS. What is the best way to achieve a line row with the buttons?

Maybe there is a way to do this code with only 1 form.

HTML

 <form action="link1" method="post"><button type="submit">Button 1</button></form>
 <form action="link2" method="post"><button type="submit">Button 2</button></form>
 <form action="link3" method="post"> <button type="submit">Button 3</button></form>

Screenshot of the page

Thank you very much!

UPDATE:

<!DOCTYPE html>
<html>
<head>

    <link rel="stylesheet" type="text/css" href="/static/style.css">  
</head>
<body>

<div class='container'>
  <form action="#" method="post"><button type="submit">Button 1</button></form>
  <form action="#" method="post"><button type="submit">Button 2</button></form>
  <form action="#" method="post"> <button type="submit">Button 3</button></form>
</div>
</body>
</html>

CSS:

.container {
    display:flex
}

Still doesn't work..

UPDATE 2: Error was fixed, it was in the path because I am using Flask I need to put the CSS inside a CSS folder. Now it is working. Thank you very much!

stracc
  • 507
  • 1
  • 4
  • 10

1 Answers1

1

.container {
display:flex
}
<div class="container" >
  <form action="link1" method="post"><button type="submit">Button 1</button></form> <form action="link2" method="post"><button type="submit">Button 2</button></form> <form action="link3" method="post"> <button type="submit">Button 3</button>
  </form> 
</div>
Asking
  • 3,487
  • 11
  • 51
  • 106
  • 1
    @Patricia Bota, is this what you want to achieve? – Asking May 01 '20 at 11:11
  • Thank you. very much for your help! But I still get the buttons in a column.. Should I have any link in the HTML head? – stracc May 01 '20 at 11:18
  • 1
    @PatriciaBota, please show more your code. If you put the forms inside container and set it to display:flex then you won't have issues. Probably is something wrong with your code – Asking May 01 '20 at 11:20
  • I edited my question with your solution and my entire code. – stracc May 01 '20 at 11:27