【问题标题】:how to make image side by side with form in html php如何在html php中与表单并排制作图像
【发布时间】:2021-08-27 01:14:18
【问题描述】:

我想制作一个带有图像的表格,如下图所示,这是我的表格 谢谢

          <div class="col-5">
            <label for="nomor_servis">Nama Bengkel</label>
            <input type="text" name="nama_bengkel" class="form-control">
          </div>
          <div class="col-5">
            <label for="nomor_servis">Nama Bengkel</label>
            <textarea name="alamat" class="form-control" cols="10" rows="4" placeholder="Alamat"></textarea>
            </textarea>
          </div>
          <div class="col-5">
            <label for="nomor_servis">Tanggal Berdiri</label>
            <input type="text" name="nama_bengkel" class="form-control">
          </div>

【问题讨论】:

  • 显示你现在完成的完整代码
  • 你可以制作两个div,并排,一个用于表单,一个用于图像。
  • 你已经在使用模板了,你可以在模板网站上找到关于网格系统的信息

标签: php html css forms image


【解决方案1】:

使用弹性框

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Document</title>
      <style>
        .flex-container {
        display: flex;
        justify-content: space-between;
        }
    
        .flex-container > div {
        line-height: 75px;
        font-size: 30px;
        }
      </style>
    </head>
    <body>
      <div class="flex-container">
        <div>
          <div class="col-5">
            <label for="nomor_servis">Nama Bengkel</label>
            <input type="text" name="nama_bengkel" class="form-control">
          </div>
          <div class="col-5">
            <label for="nomor_servis">Nama Bengkel</label>
            <textarea name="alamat" class="form-control" cols="10" rows="4" placeholder="Alamat"></textarea>
            </textarea>
          </div>
          <div class="col-5">
            <label for="nomor_servis">Tanggal Berdiri</label>
            <input type="text" name="nama_bengkel" class="form-control">
          </div>
        </div>
        <div>
          <img style="width: 400px; height: 400px" src="https://source.unsplash.com/random" />
        </div>
      </div>
    </body>
    </html>

【讨论】:

    【解决方案2】:

    你可以使用 Bootstrap Grid System 来做这件事。

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <title>Bootstrap Example</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    </head>
    <body>
    
    <div class="container-fluid" style="margin-top: 10px;">    
      <div class="row content">
        <div class="col-sm-6">
          <form action="/action_page.php">
            <div class="form-group">
              <label for="email">Email address:</label>
              <input type="email" class="form-control" id="email">
            </div>
            <div class="form-group">
              <label for="pwd">Password:</label>
              <input type="password" class="form-control" id="pwd">
            </div>
            <div class="checkbox">
              <label><input type="checkbox"> Remember me</label>
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
          </form>
        </div>
        <div class="col-sm-6"> 
          <img style="width: 100%; height: 200px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Imgur_logo.svg/1200px-Imgur_logo.svg.png" />
        </div>
      </div>
    </div>
    
    </body>
    </html>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-22
      • 1970-01-01
      • 2014-09-01
      • 2020-11-27
      • 2012-09-26
      • 1970-01-01
      • 2020-03-16
      • 2022-11-30
      相关资源
      最近更新 更多