如何使我的代码看起来像屏幕截图? http://prntscr.com/pqrax8

时间:2019-10-31 17:25:47

标签: html css

我无法使我的代码看起来像链接提供的代码。 http://prntscr.com/pqrax8如果有人可以帮助我做到这一点,将不胜感激和帮助。先感谢您。先感谢您。

.testimonials {
  font-family: 'Roboto Slab', serif;
  max-width: 250px;
  border-radius: 40px;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  padding: 20px;
  margin: 20px 0 0 0;
  position: relative;
  top: 20em;
  left: 100px;
  background-color: #fff;
}

.ellipse {
  position: static;
  max-width: 4em;
  vertical-align: middle;
  padding-right: 1em;
}

.test {
  padding-right: 1em;
  vertical-align: middle;
  line-height: 20px;
  text-align: right;
}

h2 {
  color: #60AF64;
  text-align: right;
}
<body>
  <div class="greensidebox">
    <div class="testimonials">
      <h2>Judith Cooper</h2>
      <img class="ellipse" src="images/Ellipse.png" alt="testimonialpic1">
      <div class="test">Lorem ipsum dolor sit amet.Sagittis convallis ligula metus.</div>
    </div>

    <div class="testimonials">
      <h2>Julie Howard</h2>
      <img class="ellipse" src="images/Ellipse-1.png" alt="testimonialpic1">
      <div class="test">Lorem ipsum dolor sit amet. Sagittis convallis ligula metus.</div>
    </div>

    <div class="testimonials">
      <h2>Kevin Adams</h2>
      <img class="ellipse" src="images/Ellipse-2.png" alt="testimonialpic1">
      <div>Lorem ipsum dolor sit amet. Sagittis convallis ligula metus.</div>
    </div>

  </div>


</body>

1 个答案:

答案 0 :(得分:1)

Flexbox ...我把它放到了所有东西上。

{golem}
* {
  padding: 0;
  margin: 0;
  line-height: 1;
}

.wrapper {
  background-color: lime;
  padding: 1rem;
  width: 320px;
}

.box {
  display: flex;
  background-color: #FFF;
  border-radius: 32px;
  padding: 1.5rem 0.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 8px 4px rgba(0, 0, 0, 0.2)
}

.box img {
  border-radius: 50%;
  margin-right: 1rem;
}

.box strong {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 0.25rem;
}