我该如何设计这样的html?

时间:2011-08-03 09:54:15

标签: html css forms

我如何设计我的div(“个人信息”部分)看起来像下面的例子。

enter image description here

2 个答案:

答案 0 :(得分:4)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Title</title>
    <style type="text/css">
      .personal_information label { display: inline-block; padding-right: 10px; text-align: right; width: 200px; }
    </style>
  </head>
  <body>
    <div class="personal_information">
      <h1>Booking</h1>
      <fieldset>
        <legend>Personal Information</legend>
        <label for="first_name">First Name</label><input id="first_name" name="first_name" /><br />
        <label for="last_name">Last Name</label><input id="last_name" name="last_name" />
      </fieldset>
    </div>
  </body>
</html>

答案 1 :(得分:3)

这可能是<fieldset>

相关问题