表格在一栏中,文字段落在其他栏目中

时间:2017-01-01 01:13:38

标签: html css forms grid-system

如何在容器的一面有一个表格,另一面有文字段?我想如果我把它全部放在一个有两行的行的容器中它会起作用但是由于某种原因,段落文本显示在左侧的表格下面。

这是根据我现在的代码发生的截图。

Img

<div class="container-section getintouch">
    <h1 class="text-center">Say hello?</h1>
    <div class="row">
      <div class="col-xs-6">

        <form>
            <div class="form-group">
              <input type="text" class="form-control no-border    
               placeholder="Email">
            </div>
            <div class="form-group">
              <input type="text" class="form-control no-border"     
              placeholder="Email">
            </div>
  <textarea class="form-control no-border" rows="5" id="comment"></textarea>
            </div>
          </form>

      </div>
      <div class="col-xs-6">
        <h3>Want to say hello? It's always nice meeting new people. Fill out 
            this form to the left and I'll reply to you as soon as I can :)     
        </h3>
      </div>
    </div>enter code here

.container-section{
  width: full;
  height: full;
  margin: 0 auto;
  padding: 100px;
  color: white;
}

.getintouch{
  background: #9dd1f1;
}

我刚刚开始学习编码,所以如果这看起来像一个愚蠢的问题,我道歉。我四处搜索,无法在任何地方找到答案。

提前谢谢!

1 个答案:

答案 0 :(得分:1)

在提出任何问题之前,请正确学习HTML和CSS。

  1. 没有值为full的CSS规则。
  2. 不要padding完整width
  3. 您忘了添加container课程。
  4. 许多无效的HTML,未公开的内容。
  5. <强>段

    &#13;
    &#13;
    .container-section {
      -margin: 0 auto;
      -color: white;
    }
    .getintouch {
      background: #9dd1f1;
    }
    &#13;
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
    <div class="container-section getintouch">
      <h1 class="text-center">Say hello?</h1>
      <div class="container">
        <div class="row">
          <div class="col-xs-6">
            <form>
              <div class="form-group">
                <input type="text" class="form-control no-border" id=formGroupExampleInput " placeholder="Name "">
              </div>
              <div class="form-group">
                <input type="text" class="form-control no-border" id=formGroupExampleInput2 " placeholder="Email "">
              </div>
              <div class="form-group">
                <textarea class="form-control no-border" rows="5" id="comment"></textarea>
              </div>
            </form>
          </div>
          <div class="col-xs-6">
            <h3>Want to say hello? It's always nice meeting new people. Fill out this form to the left and I'll reply to you as soon as I can :)</h3>
          </div>
        </div>
      </div>
    &#13;
    &#13;
    &#13;

    预览

    preview

    输出:http://jsbin.com/mepiripeju/edit?html,css,output