首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >CSS HTML我的文本对齐和我的显示内嵌块不起作用

CSS HTML我的文本对齐和我的显示内嵌块不起作用
EN

Stack Overflow用户
提问于 2018-06-14 03:57:58
回答 1查看 34关注 0票数 1

代码

代码语言:javascript
复制
#step-1,
#step-2,
#step-3 {
  display: inline-block;
  text-align: 30px;
  height: 150px;
}
代码语言:javascript
复制
<section id="steps">
  <div class="wrapper">
    <ul>
      <li id="step-1">
        <img src="IMAGE/steps-icon-1.png">
        <h3 class="toUppercase">Plannifier</h3>
        <p>text text text </p>
      </li>
      <li id="step-2">
        <img src="IMAGE/steps-icon-2.png">
        <h3 class="toUppercase">Organiser</h3>
        <p>text text text</p>
      </li>
      <li id="step-3">
        <img src="IMAGE/steps-icon-3.png">
        <h3 class="toUppercase">Voyager</h3>
        <p>text text text</p>
      </li>
    </ul>
  </div>

它正在做什么

[

我想要实现的东西

[

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-14 04:07:19

使用flex来实现这一点

代码语言:javascript
复制
.wrapper {
  width: 80%;
  margin: auto;
}

ul {
  display: flex;
  justify-content: space-around;
  list-style-type: none;
}

#step-1,
#step-2,
#step-3 {
  margin-right: 15px;
  height: 150px;
  width: 30%;
}
代码语言:javascript
复制
<section id="steps">
  <div class="wrapper">
    <ul>
      <li id="step-1">
        <img src="IMAGE/steps-icon-1.png">
        <h3 class="toUppercase">Plannifier</h3>
        <p>text text text </p>
      </li>
      <li id="step-2">
        <img src="IMAGE/steps-icon-2.png">
        <h3 class="toUppercase">Organiser</h3>
        <p>text text text</p>
      </li>
      <li id="step-3">
        <img src="IMAGE/steps-icon-3.png">
        <h3 class="toUppercase">Voyager</h3>
        <p>text text text</p>
      </li>
    </ul>
  </div>
</section>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50845291

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档