我试图以第3页的服务框为中心,但无论如何我似乎都无法将它们以页面为中心。我对此完全是菜鸟,所以任何帮助都会很棒。这是我当前的代码。我在想我可能需要在一个容器或某些东西中创建每个div并将属性应用于该容器?或者这可能是使用代码块元素的Avada主题存在的问题。



.solutions_box {
  position: relative;
  margin: 50px auto;
  text-align: center;
  border-radius: 5px;
  background: #ffffff;
  transition: all 0.30s ease 0s;
  border-left: 1px solid #D3D3D3;
  border-right: 1px solid #D3D3D3;
  border-top: 4px solid #74AA50;
  box-shadow: 0 0 10px 5px #D3D3D3;
}

.solutions_box .solutions_icon {
  width: 70px;
  height: 70px;
  margin: 50px auto;
  font-size: 35px;
  background: #ffffff;
  line-height: 70px;
  border-radius: 50px;
  transform: translateY(0);
  transition: all 0.30s ease 0s;
}

.solutions_box .solutions_icon {
  transform: translateY(-100%);
  border-radius: 50px;
  border: 2px solid #74AA50;
}

.solutions_box .solutions_icon i {
  color: #000000;
}

.solutions_box h3 {
  position: relative;
  top: -75px;
  margin: 0;
  color: #666666;
  font-size: 23px;
  text-transform: uppercase;
  transform: translateY(0%);
  transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55) 0s;
  font-family: 'TwCenMTStd-MediumCond', 'Lato', Helvetica, sans-serif;
}

.service_list .list_item {
  margin: 0;
  opacity: 1;
  transition: all 0.30s linear 0s;
  font-size: 20px;
  border-top: solid #ececec 2px;
}

.service_list p {
  color: #666666;
  margin-bottom: 10px;
  padding: 13px;
  font-size: 20px;
}

.service_list:hover .list_item p {
  transition: .25s ease;
  -webkit-transform: scale(1.05);
  -ms-transform: scale(1.05);
  transform: scale(1.05);
  color: #74AA50;
  text-decoration: none;
}

.service_list:hover .list_item a {
  transition: .25s ease;
  -webkit-transform: scale(1.05);
  -ms-transform: scale(1.05);
  transform: scale(1.05);
  color: #74AA50;
  text-decoration: none;
}

<link href="https://fonts.googleapis.com/css?family=Alegreya+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="container">
  <div class="row">
    <div class="col-md-4 col-sm-6">
      <div class="solutions_box">

        <div class="solutions_icon">
          <i class="fa fa-code"></i>
        </div>

        <h3>End User Support</h3>
        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p>Solutions</p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\soultions">
              <p> More Stuff </p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p> Stuff </p>
            </a>
          </div>
        </div>
      </div>
    </div>


    <div class="col-md-4 col-sm-6">
      <div class="solutions_box">

        <div class="solutions_icon">
          <i class="fa fa-code"></i>
        </div>

        <h3>End User Support</h3>
        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p>Solutions</p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\soultions">
              <p> More Stuff </p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p> Stuff </p>
            </a>
          </div>
        </div>
      </div>
    </div>


    <div class="col-md-4 col-sm-6">
      <div class="solutions_box">

        <div class="solutions_icon">
          <i class="fa fa-code"></i>
        </div>

        <h3>End User Support</h3>
        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p>Solutions</p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\soultions">
              <p> More Stuff </p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p> Stuff </p>
            </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

最佳答案

因此,看起来问题出在容器中,在其中添加div class =“ container-fluid”大部分可以纠正问题。现在似乎更集中,除了一个对象外,但这可能只是对象放置问题。话虽如此,盒子现在已经正确排列了。



<link href="https://fonts.googleapis.com/css?family=Alegreya+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="container-fluid">
  <div class="row">
    <div class="col-sm-4">
      <div class="solutions_box">

        <div class="solutions_icon">
          <i class="fa fa-code"></i>
        </div>

        <h3>End User Support</h3>
        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p>Solutions</p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\soultions">
              <p> More Stuff </p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p> Stuff </p>
            </a>
          </div>
        </div>
      </div>
    </div>


    <div class="col-md-4 col-sm-6">
      <div class="solutions_box">

        <div class="solutions_icon">
          <i class="fa fa-code"></i>
        </div>

        <h3>End User Support</h3>
        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p>Solutions</p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\soultions">
              <p> More Stuff </p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p> Stuff </p>
            </a>
          </div>
        </div>
      </div>
    </div>


    <div class="col-md-4 col-sm-6">
      <div class="solutions_box">

        <div class="solutions_icon">
          <i class="fa fa-code"></i>
        </div>

        <h3>End User Support</h3>
        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p>Solutions</p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\soultions">
              <p> More Stuff </p>
            </a>
          </div>
        </div>

        <div class="service_list">
          <div class="list_item">
            <a href="\solutions">
              <p> Stuff </p>
            </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

关于html - 如何在Wordpress网站上居中放置3个服务框,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51296368/

10-10 00:26