-10

I want to have this layout:

My try:

.container{
  padding: 10 px;
  gap: 10 px;
  flex-direction: row;
}
figcaption{
  font-size: smaller;
  text-align: end;
}
<blockquote>Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, iste incidunt fuga aliquam veniam mollitia enim nam deserunt magni iure repudiandae aspernatur reprehenderit totam quia aut laborum quos, vel quis!</blockquote>

<figure class="container">
<figcaption>
  <strong>John Doe</strong><br>
  Long title blablablablabla<br>
  Company X
</figcaption>
<img class="col2" src="https://placehold.co/600x400">
<figure>

I don't know how to make it better. Can you help me improve it?

2
  • 1
    Can you amend the HTML at all?
    – Paulie_D
    Commented Jul 7 at 20:42
  • What do you mean by amending? Surely I can edit the HTML.
    – Ooker
    Commented Jul 8 at 0:51

1 Answer 1

1

Something like this:

* {
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}
::before,
::after {
  box-sizing: inherit;
}

.wrap {
  display: flex;
  border: 1px solid green;
  gap: .25em;
  margin: 1em;
}
.details {
  display: flex;
  flex-direction: column;
}

.details blockquote {
  margin-bottom:auto;
  text-align: justify;
  display: flex;
  align-items: center;
}

blockquote:before, blockquote:after {
  content: '“';
  font-size: 4em;
  padding: 0 .25em;
}

blockquote:after  {
  align-self: end;
  content: '”';
}

.details div {
  align-self: end;
}

div img {
  max-width: 100%;
  height: auto;
  display: block;
}

span {
  align-self: end;
}
<div class="wrap">
  <div class="details">
    <blockquote>Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, iste incidunt fuga aliquam veniam mollitia enim nam deserunt magni iure repudiandae aspernatur reprehenderit totam quia aut laborum quos, vel quis!</blockquote>
    <div><strong>John Doe</strong></div>
    <div>Long title blablablablabla</div>
    <div>Company X</div>
  </div>

  <div><img class="col2" src="https://placehold.co/600x400"></div>

</div>

5
  • Is there a way to keep the semantic tags instead of using div?
    – Ooker
    Commented Jul 9 at 15:16
  • You could but figure here is not really semantic. Just because it contains an image does not make it a figure - developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
    – Paulie_D
    Commented Jul 9 at 15:21
  • In my understanding the link says that figure can be used for other stuffs, not just image. But I don't see where it explains that using figure for images isn't really semantic. Can you elaborate?
    – Ooker
    Commented Jul 9 at 15:35
  • " a <figure> is an image, illustration, diagram, code snippet, etc., that is referenced in the main flow of a document," Your image is not referenced in the document, it's just a logo as far as I can tell. By all means you can use a figure if you want, it's your code, do what you want.
    – Paulie_D
    Commented Jul 9 at 15:38
  • I see. Hmm, would the image of the author of the quote be counted as being referenced in the main flow of the document? So the reason you change the tag to div because you think that the image is not qualified as semantic figure?
    – Ooker
    Commented Jul 9 at 16:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.