如何将表单保留在同一行?

时间:2017-04-25 19:21:40

标签: html css

我需要三个表格在同一行,并希望它们左,中,右。我已多次尝试过请帮忙。谢谢你的帮助。对不起,在这样一个新的编码器中,但是我想学习,我认为你可以帮忙

    <!DOCTYPE html>
     <html>
      <head>
       <title>Conspiracy Theories</title>
        <link href="p1.css" type="text/css" rel="stylesheet">
         </head>
          <body>
           <h1>World reacts to US strikes, with many expressing support</h1>

        <div class="div1">
         <form action="WP8.html"><input type="submit" value="Prev." /></form>
         <form action="web.html"><input type="submit" value="Home" /></form>
         <form action="WP10.html"><input type="submit" value="Next" /></form>
        </div>

      <center><img src="http://www.darpa.mil/DDM_Gallery/gremlins-619-316-pp.jpg"></center>

          ect...

1 个答案:

答案 0 :(得分:0)

您可以在这些按钮的容器上使用display: flexjustify-content: space-between;。这将在容器/页面的宽度上平均分配按钮:

.div1 {
  display: flex;
  justify-content: space-between;
}
<!DOCTYPE html>
<html>

<head>
  <title>Conspiracy Theories</title>
  <link href="p1.css" type="text/css" rel="stylesheet">
</head>

<body>
  <h1>World reacts to US strikes, with many expressing support</h1>

  <div class="div1">
    <form action="WP8.html"><input type="submit" value="Prev." /></form>
    <form action="web.html"><input type="submit" value="Home" /></form>
    <form action="WP10.html"><input type="submit" value="Next" /></form>
  </div>

  <center><img src="http://www.darpa.mil/DDM_Gallery/gremlins-619-316-pp.jpg"></center>