行/列不使用骨架css

问题描述 投票:0回答:1

我试图使用skeleton.css在我的页面上获得三个部分(每个1/3长度)。该框架的网站是skeleton。这是我的代码:

<!DOCTYPE html>

<html>

<head>
  <style type="text/css" href="css/normalize.css" rel="stylesheet"></style>
  <style type="text/css" href="css/skeleton.css" rel="stylesheet"></style>
</head>

<body>
  <div class="container">
    <div class="row">
      <div class="three columns">
        1
      </div>
    </div>

    <div class="row">
      <div class="three columns">
        2
      </div>
    </div>

    <div class="row">
      <div class="three columns">
        3
      </div>
    </div>
  </div>
</body>

</html>
html css skeleton-css-boilerplate
1个回答
1
投票

因为你想要你的3rds中的列,使用one-third类而不是将第二类固定到columncolumns的位置。您还应该删除另外两个row容器并将它们全部放在一起:

.example-grid .column {
  background: #EEE;
  text-align: center;
  border-radius: 4px;
  font-size: 1rem;
  text-transform: uppercase;
  height: 30px;
  line-height: 30px;
  margin-bottom: .75rem;
  font-weight: 600;
  letter-spacing: .1rem;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css" rel="stylesheet" />
<!DOCTYPE html>

<html>

<head>
  <style type="text/css" href="css/normalize.css" rel="stylesheet"></style>
  <style type="text/css" href="css/skeleton.css" rel="stylesheet"></style>
</head>

<body>
  <div class="container example-grid">
    <div class="row">
      <div class="one-third column">
        1
      </div>

      <div class="one-third column">
        2
      </div>

      <div class="one-third column">
        3
      </div>
    </div>
  </div>
</body>

</html>
© www.soinside.com 2019 - 2024. All rights reserved.