1

请随时纠正我,但根据我对引导 CSS 的理解,spans1、2、3、4 等应该使在网页上布局数据变得容易。一整行应该是一个 span12 意味着两个 6 个跨度应该等于一整行,内容是 50/50 间隔?到目前为止这是正确的吗?

<div class="hero-unit">
    <div class ="span4">First name: <input  type="text"  runat="server" placeholder="Enter First Name" name="firstname" id="firstname"/></div>
    <div class ="span4">Last name: <input  type="text"  runat="server" placeholder="Enter Last Name" name="lastname" id="lastname"/></div>
    <div class ="span2">Student Number: <input  type="text"  runat="server" placeholder="Enter Student Number" name="Student Number" id="StudentNumber"/> </div>
    <div class ="span2">Course code & Name:  <input  type="text"  runat="server" placeholder="Enter Course Code" name="CourseCode" id="CourseCode"/></div>
    <div class ="span4">Course code & Name: <input   type="text" runat="server" placeholder="Enter Course Code" name="CourseCode" id="Text1"/> </div>
</div>

结果看起来没有我所期望的那样。此处表格混乱的图像示例 http://img546.imageshack.us/img546/6361/35787686.png

4

1 回答 1

1

再次感谢汤姆解决方案代码如下:-

<div class="row-fluid">
  <h1>Personal Details</h1></div><div class="row hero-unit">
  <div class="row-fluid">
    <div class ="span2">First name:</div> 
    <div class="span4">
      <input  type="text"  runat="server" 
              placeholder="Enter First Name" 
              name="Firstname" id="Firstname" />
    </div>
    <div class ="span2">Last name:</div> 
    <div class="span4">
       <input  type="text"  runat="server" 
               placeholder="Enter Last Name" 
               name="Lastname" id="Lastname"/>
    </div>
  </div>
  <div class="row-fluid">
    <div class ="span2">Student Number:</div> 
    <div class="span4"> 
      <input type="text"  runat="server" 
             placeholder="Enter Student Number" 
             name="Student Number" id="StudentNumber"/>
    </div>
    <div class ="span2">Course Name:</div> 
    <div class="span4"> 
      <input type="text"  runat="server" 
             placeholder="Enter Course Code" 
             name="CourseCode" id="CourseCode"/>
    </div> 
  </div>
  <div class="row-fluid">
    <div class ="span2">Mail Address:</div> 
    <div class="span10">
      <input type="text" class="span10" runat="server" 
             placeholder="Enter Postal Address" 
             name="PostalAddress" id="PostalAddress"/> 
    </div>
  </div>
</div>

可以在这里看到更好的格式化结果:- http://imageshack.us/photo/my-images/502/homepageim.png/

于 2012-08-16T22:59:16.123 回答