ZBLOG

.onboarding-guide { width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); position: fixed; top: 0; z-index: 9; .guide-step-one { width: 100%; height: 100%; text-align: center; img { width: 337px; heig...

要让.guide-step-one水平垂直居中,可以使用flex布局和对应的属性设置。可以按照以下方式修改CSS代码:

.guide-step-one {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */
  text-align: center;
  
  img {
    width: 337px;
    height: 272px;
  }
  
  .step-button {
    width: 100%;
    display: flex;
    justify-content: center;
    
    li {
      margin: 0 10px;
    }
    
    li:nth-child(1) button {
      width: 120px;
      height: 36px;
      background-color: red;
      border-radius: 330px;
      border: none;
    }
    
    li:nth-child(2) button {
      width: 120px;
      height: 36px;
      background-color:#f35440 ;
      color:#ffffff ;
      border-radius:330px ;
      border:none ;
    }
}

通过添加display:flex; justify-content:center; align-items:center;属性,可以使.guide-step-one元素水平垂直居中。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=15130

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?