css 创建自定义google样式div

np8igboo  于 2022-12-15  发布在  Go
关注(0)|答案(1)|浏览(158)

div图像

我基本上需要让用户数据留在个人资料图片的前面(有字母的圆形图片)
基本上,我遇到问题的是用户数据,因此它位于前面
我的代码到目前为止

<div class="conta">
    <p>Você está logado com:</p>
        <div class="perfil">{{name}}</div>
        <div class="dadosUser">
            <p>{{user.username}}</p>
            <p>{{user.email}}</p>    
        </div>
.conta{
    border: 1px solid var(--primary-color);
    padding: 15px;
    border-radius: 5px;
    margin-left: 30%;
    margin-right: 30%;
    }

perfil div是用户的照片出现的地方,或者只是那个带字母的小球

mnemlml8

mnemlml81#

你需要多一点HTML和CSS,但这应该工作:

* {
  font-family: Arial, “Helvetica Neue”, Helvetica, sans-serif;
  font-size: 14px;
}

.container {
  width: 75%;
  margin: 0 auto;
}

.card {
  border: 0.1em solid darkgrey;
  border-radius: 0.5em;
  padding: 1em;
}

  .card .card-header {
    margin: 0.5em;
    color: darkgray;
  }

  .card .card-body {
    display: flex;
  }

  .card-body .card-col {
    margin: 0.5em;
    display: flex;
  }

  .card-body .card-col-push {
    margin-left: auto;
  }

    .card-col .user-img {
      width: 2em;
      height: 2em;
      font-size: 20px;
      color: #fff;
      background-color: #00adad;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .card-col .user-info {
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
    }

    .card-col .user-name {
      font-weight: bold;
    }

    .card-col .user-email {
      font-size: 12px;
      color: darkgray;
    }

    .card-col .btn-container {
      display: flex;
      align-items: center;
    }

      .btn-container .btn {
        margin: 0;
        border: 0.1em solid #e7e7e7;
        border-radius: 0.5em;
        background-color: white;
        color: cornflowerblue;
        padding: 0.5em 1.5em;
        font-weight: bold;
        cursor: pointer;
      }

      .btn-container .btn:hover {
        background: #e7e7e7;
      }
<div class="container">
  <div class="card">
    <div class="card-header">
      Você fez login como
    </div>
    <div class="card-body">
      <div class="card-col">
        <div class="user-img">
          E
        </div>
      </div>
      <div class="card-col">
        <div class="user-info">
          <div class="user-name">
            Epamer
          </div>
          <div class="user-email">
            epamer8880@gmail.com
          </div>
        </div>
      </div>
      <div class="card-col card-col-push">
        <div class="btn-container">
          <button class="btn">Mudar de conta</button>
        </div>
      </div>
    </div>
  </div>
</div>

相关问题