一行上有两个文本正文

时间:2016-04-10 23:53:55

标签: html css

我试图在GitHub上创建我的用户页面。我计划在屏幕左侧显示文字,在屏幕右侧显示文字。现在的代码看起来像这样。

make run-error1

这就是现在的样子。 https://gyazo.com/cf4eb2c3f0d92eec714c8d926cf38af6

2 个答案:

答案 0 :(得分:1)

text-align属性用于元素的内容,我认为你试图让元素浮动在任何一方。另外,你的元素是分开的,并不是所有东西都是一个特殊用途的标题read this

total > maxElements

答案 1 :(得分:0)

使用这样的响应式网格:



/*  SECTIONS  */

.section {
  clear: both;
  padding: 0px;
  margin: 0px;
}


/*  COLUMN SETUP  */

.col {
  display: block;
  float: left;
  margin: 1% 0 1% 1.6%;
}

.col:first-child {
  margin-left: 0;
}


/*  GROUPING  */

.group:before,
.group:after {
  content: "";
  display: table;
}

.group:after {
  clear: both;
}

.group {
  zoom: 1;
  /* For IE 6/7 */
}


/*  GRID OF TWO  */

.span_2_of_2 {
  width: 100%;
}

.span_1_of_2 {
  width: 49.2%;
}


/*  GO FULL WIDTH AT LESS THAN 480 PIXELS */

@media only screen and (max-width: 480px) {
  .col {
    margin: 1% 0 1% 0%;
  }
}

@media only screen and (max-width: 480px) {
  .span_2_of_2,
  .span_1_of_2 {
    width: 100%;
  }
}

<div class="section group">
  <div class="col span_1_of_2">
    <b>About Me</b>
    <p>Name: Jet "Humding3r" Geronimo
      <br /> Age: 11</p>
  </div>

  <div class="col span_1_of_2">
    <b>My Stuff</b>
    <p>Hobbies: Coding, Gaming, Music</p>
  </div>
</div>
&#13;
&#13;
&#13;

相关问题