title: How to put two images side by side with captions below (Markdown and HTML)
body: <p>everyone! I hope you are all fine.</p>
  <h3>Background</h3>
  <p>I'm a beginner in web development and I'm studying pure HTML, CSS and JS for front-end. In parallel, I've been studying Git to version my study/case study projects. I decided to create a README for my GitHub profile, because I saw some really cool customizations and I'm wanting to give &quot;my personality&quot; to my profile, in order to create contact and network with people from web development and data analysis (two areas I've been studying). Also, I saw a good opportunity to practice HTML incorporated into Markdown.</p>
  <p>I made almost the entire file using the &quot;details&quot; and &quot;summary&quot; tags so that the person reading it can open and close each section of information. Since one of the sectors talks about my &quot;passions&quot; and one of them is reading, I thought it would be interesting (and more &quot;human&quot;) to add what I am reading at the moment. So, I added a section to put the two books I'm reading/studying at the moment. The idea was to put an image of each book (so two images) and a caption below each image with the chapter that is currently being read (so two subtitles). I did some research on the use of the &quot;img&quot; tag and the best practices for inserting images in Markdown and HTML files and came to the conclusion that it would be better to add the images with HTML tags. To do this I used the &quot;figure&quot;, &quot;img&quot; and &quot;figcaption&quot; tags.</p>
  <h3>What I wrote</h3>
  <pre><code>&lt;details&gt;
      &lt;summary&gt;&lt;strong&gt;What am I reading now?&lt;/strong&gt;&lt;/summary&gt;  
          &lt;div style=&quot;display: flex; justify-content:space-between;&quot;&gt;
              &lt;figure style=&quot;text-align:center; flex:1;&quot;&gt;
                  &lt;img src=&quot;src/book1.png&quot; alt= &quot;Summit Lake - Charles Donlea&quot; width=&quot;200px&quot;/&gt;
                  &lt;figcaption styles=&quot;text-align: center;&quot;&gt;Chapter 26&lt;/figcaption&gt;
              &lt;/figure&gt;
              &lt;figure style=&quot;text-align:center; flex:1;&quot;&gt;
                  &lt;img src=&quot;src/book2.png&quot; alt= &quot;Confident Data Skills - Kirill Eremenko&quot; alt=&quot;Confident Data Skills&quot; width=&quot;200px&quot;/&gt;
                  &lt;figcaption styles=&quot;text-align: center;&quot;&gt;Chapter 2&lt;/figcaption&gt;
              &lt;/figure&gt;
          &lt;/div&gt;
  
  &lt;/details&gt;&amp;nbsp;
  </code></pre>
  <h3>Explaining what I done</h3>
  <p>As you can notice, I added a &quot;div&quot; because I concluded it would be better for stylizing the content on the screen. I set each image to have a width of 200 pixels and made use of flexbox to try to settle the images on the screen (even though I used &quot;block&quot; and &quot;inline-block&quot; before the &quot;flex&quot;).</p>
  <h3>Problem Statement</h3>
  <p>I had a little trouble getting the images side by side and the captions below them, but in the end I understood what I was doing wrong. I am using VsCode as an editor and installed the &quot;Markdown Preview Enhanced&quot; plugin. And this is where the bizarre thing comes from: opening the preview in VsCode, the images are perfectly aligned and the captions are properly centered just below each image. However, when I upload it to GitHub, the images sit side by side, but the caption is on the right side of each image.</p>
  <h3>What I tried</h3>
  <p>I played with the spacing and display in the style. Initially I had written a &quot;style&quot; tag to be able to make the file more organized, but I found out that GitHub breaks this tag in the README for security reasons. So I passed the &quot;style&quot; tag as an argument to the proper tags (as you can see in the attachment above). I opened my browser's developer tool (I'm using the most current version of Chromium) and tried to understand and solve the problem. I could see that an &quot;a&quot; tag was added right after the &quot;div&quot; tag, and this is not in my original script. I concluded that a link was automatically added for when anyone clicks on the image, send them to the &quot;src&quot; folder that I created to store the images. This leads me to believe that it maybe captions have been &quot;pushed&quot; to the right side of the images because of that. I tried to highlight the &quot;boxes&quot; to see if I understood what was going on, and when I highlighted them it looked like 4 boxes (one for each image and one for each caption) were created side by side (which fried my head, honestly).</p>
  <p>So I want to know if this is a bug in GitHub (since in the Preview in VsCode it looks normal) or if there is something wrong with what I did. Below, I attach the screenshots of the Preview and what appears in the README inside GitHub:</p>
  <p><a href="https://i.stack.imgur.com/cxgNe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cxgNe.png" alt="VSCode" /></a><br />
  <a href="https://i.stack.imgur.com/tz2qN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tz2qN.png" alt="GitHub" /></a></p>
  <h3>Finalizing</h3>
  <p>Anyway, I apologize if the text was too long. As I like to know the context of things when someone asks me something, I also like to give a context so that people can understand the problem. Thank you for any help I can get. o/</p>
  <p>If anyone wants to see the problem, you can open my GitHub profile page <a href="https://github.com/bryrrea" rel="nofollow noreferrer">here</a>.</p>
  <p>PS: I'm not a native. So if I wrote something wrong or if there are any problems with my grammar, please correct me and let me know what I'm doing wrong. ^^</p>