首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >水平对齐按钮

水平对齐按钮
EN

Stack Overflow用户
提问于 2022-11-20 05:58:37
回答 2查看 38关注 0票数 -1

我试图建立我的投资组合网站,我没有任何以前的知识,html。我试图水平对齐按钮在网页上,并希望我可以得到一些帮助,我可以如何编辑这段代码,以解决这个对齐问题。

网页

下面是代码片段:

代码语言:javascript
复制
<article>
   <header>
      <h2><a href="#">Labeling using<br />
         Weak Supervision</a>
      </h2>
   </header>
   <a href="#" class="image fit"><img src="images/Snorkel-AI.png" alt="" width =auto height =auto /></a>
   <p>Snorkel is a system for programmatically building and managing training datasets using the concept of weak supervision. This use cases demonstrates programtically labeling of text messages as spam or non-spam using snorkel.</p>
   <ul class="actions special">
      <li><a href="https://github.com/tauseef1234/Spam_Labeling_Snorkel/blob/main/SMS_Snorkel.ipynb" class="button">GitHub</a></li>
   </ul>
</article>
<article>
   <header>
      <h2><a href="#">Traffic Sign <br />
         Detection</a>
      </h2>
   </header>
   <a href="#" class="image fit"><img src="images/traffic.png" alt="" width =auto height =auto /></a>
   <p>In this project, I use TensorFlow to build a neural network to classify road signs based on an image of those signs. For this project, the German Traffic Sign Recognition Benchmark (GTSRB) dataset was used that contains thousands of images of 43 different kinds of road signs. </p>
   <ul class="actions special">
      <li><a href="https://github.com/tauseef1234/Traffic_CNN" class="button">GitHub</a></li>
   </ul>
</article>

我尝试添加额外的空格,但这需要在现有代码中进行大量的编辑。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-11-20 06:07:55

用挠性盒工作。添加text-align: center使其垂直中心对齐。

代码语言:javascript
复制
/* Put all of the bottom code */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

section {
  display: flex;
}

section article {
  width: 50%;
  /* -------------- */
  text-align: center;
  /* ----- or ----- / */
  /*** display: flex;
  flex-direction: column;
  align-items: center ***/
  /* -------------- */
}
代码语言:javascript
复制
<section class="container"> <!-- Put this line -->
  <article>
    <header>
      <h2><a href="#">Labeling using<br />
         Weak Supervision</a>
      </h2>
    </header>
    <a href="#" class="image fit"><img src="images/Snorkel-AI.png" alt="" width=auto height=auto /></a>
    <p>Snorkel is a system for programmatically building and managing training datasets using the concept of weak supervision. This use cases demonstrates programtically labeling of text messages as spam or non-spam using snorkel.</p>
    <ul class="actions special">
      <li><a href="https://github.com/tauseef1234/Spam_Labeling_Snorkel/blob/main/SMS_Snorkel.ipynb" class="button">GitHub</a></li>
    </ul>
  </article>
  <article>
    <header>
      <h2><a href="#">Traffic Sign <br />
         Detection</a>
      </h2>
    </header>
    <a href="#" class="image fit"><img src="images/traffic.png" alt="" width=auto height=auto /></a>
    <p>In this project, I use TensorFlow to build a neural network to classify road signs based on an image of those signs. For this project, the German Traffic Sign Recognition Benchmark (GTSRB) dataset was used that contains thousands of images of 43 different
      kinds of road signs. </p>
    <ul class="actions special">
      <li><a href="https://github.com/tauseef1234/Traffic_CNN" class="button">GitHub</a></li>
    </ul>
  </article>
</section> <!-- Put this line -->

票数 0
EN

Stack Overflow用户

发布于 2022-11-20 07:19:18

使用text-align: center;

代码语言:javascript
复制
display:flex;
align-items:center;
justify-content:center;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74505993

复制
相关文章

相似问题

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