首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何正确地对引导图标进行居中,并在其与P元素之间添加空间?

如何正确地对引导图标进行居中,并在其与P元素之间添加空间?
EN

Stack Overflow用户
提问于 2021-01-31 19:30:50
回答 1查看 548关注 0票数 0

我正在将一些引导图标合并到我的HTML页面中。通过将style=“文本对齐:中心”添加到我围绕它创建的DIV中,我现在能够将其中的两个居中。我不确定这是否是正确的方法,但如果我错了,请纠正我。

我现在的问题是,我试图在另一个图标和它上面的一个P元素之间创建空间,但是填充顶部似乎不起作用。通过在CSS样式表中的标题中添加填充,我设法在第一个图标和标题之间创建了空间,但是即使这样做,我也可能会以错误的方式进行操作。

第一图标 第二图标

如何正确地在第二个图标和P元素之间添加空间?我在上面添加了“想象”来展示我在说什么。我对HTML和编码非常陌生。

代码语言:javascript
运行
复制
html {
  background-color: #85BDA6;
}

#header {
  text-align: center;
  font-size: 35px;
  padding-top: 80px;
  padding-bottom: 50px;
  
}

#header-2 {
  text-align: center;
  font-size: 30px;
  padding-bottom: 20px;
  padding-top: 50px;
}

#header-3 {
  text-align: center;
  font-size: 30px;
  padding-bottom: 20px;
  padding-top: 50px;
}

#header-4 {
  text-align: center;
  font-size: 22px;
}

#header-5 {
  text-align: center;
  font-size: 22px;
  padding-top: 20px;
}

#header-6 {
  text-align: center;
  font-size: 30px;
  margin:0;
  padding:0;
  padding-top: 50px;
 
}

#pricing {
  padding-bottom: 50px;
  padding-top: 20px;
}

p {
  font-size: 19px;
  line-height: 1.7;
  text-align: center;
}

#video {
   margin-left: auto;
   margin-right: auto;
   display: block
   
}

#email {
  display: inline-block;
  
}

#submit {
  display: inline-block;
}

.input {
  text-align: center;
  padding-top: 30px;
  padding-bottom: 30px;
  
}

#email {
  width: 20%;
  height: 25px;
}

#submit {
  height: 30px;
}

#nav-bar {
position: fixed;
top: 0;
right: 0;
padding-right: 15px;
background-color: grey;
padding-bottom: 10px;
width: 100%;
opacity: 0.5;

}

.nav-options {
  font-size: 23px;
  padding-top: 10px;
  text-decoration: none;
  display: flex;
  justify-content: end;
  display: inline;
  right: 0;
  color: white;
  opacity: 1;
}

.nav-options:hover {
  text-decoration: none;
}

.bi bi-truck {

    display: block;
    margin: auto;    
}

.bi bi-emoji-smile {
  
}

@media (min-width: 500px;) {
  p {
    font-size: 18px;
  }
}
代码语言:javascript
运行
复制
<div style="text-align: center">
  <svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="currentColor" class="bi bi-emoji-smile" viewBox="0 0 16 16">
  <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
  <path d="M4.285 9.567a.5.5 0 0 1 .683.183A3.498 3.498 0 0 0 8 11.5a3.498 3.498 0 0 0 3.032-1.75.5.5 0 1 1 .866.5A4.498 4.498 0 0 1 8 12.5a4.498 4.498 0 0 1-3.898-2.25.5.5 0 0 1 .183-.683zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zm4 0c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5z"/>
</svg>
        </div>

EN

回答 1

Stack Overflow用户

发布于 2021-01-31 21:41:17

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

https://stackoverflow.com/questions/65983340

复制
相关文章

相似问题

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