Looking for a solution similar to the problem presented in this Stack Overflow thread about positioning text next to an image, but specifically when using "display: flex".
We are facing an issue where a comment, consisting of an avatar image and accompanying text, is supposed to be displayed on the right side of the avatar. However, when the text is long, it jumps below the avatar instead:
https://i.stack.imgur.com/VXrdc.png
The goal is to set the width of the avatar and have the comment take up the remaining available width.
//CSS Snippeta.inner-anchor {
cursor: default;
}
div.github-comments {
width: 70vw;
margin: auto;
border: 1px solid #e1e4e8;
border-radius: 6px;
padding: 40px;
}
//HTML Code
<div class="github-comments">
<h2>Comments</h2>
<ul id="gh-comments-list">
<li>
<a href="https://github.com/" class="user">
<img class="avatar" src="https://avatars3.githubusercontent.com/u/45234211?v=4">
</a>
<div class="comment-content">
<p>A Comment.</p>
</div>
<a href="https://github.com/" class="comment-url">#616068412 - 2020-04-19T07:44:35Z</a>
</li>
<li>
<a href="https://github.com/" class="user">
<img class="avatar" src="https://avatars3.githubusercontent.com/u/45234211?v=4">
</a>
<div class="comment-content">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
</div>
<a href="https://github.com/" class="comment-url">#616068412 - 2020-04-19T07:44:35Z</a>
</li>
<li>
<a href="https://github.com/" class="user">
<img class="avatar" src="https://avatars0.githubusercontent.com/u/45391682?v=4">
</a>
<div class="comment-content">
<p>It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
</div>
<a href="https://github.com/" class="comment-url">#618986438 - 2020-04-24T12:44:51Z</a>
</li>
</ul>
<p id="no-comments-found">No comments found for this article.</p>
<p id="loading-comments" style="display: none;">Loading comments...</p>
<p id="next-comments-page" style="display: none;">next comments page</p>
<p id="leave-a-comment">Join the discussion for this article on <a href="https://github.com/">this ticket</a>. Comments appear on this page instantly.</p>
</div>
For further reference, check out this fiddle showcasing the issue: https://jsfiddle.net/otmjrks6/