0

I dont know if this is the right place to ask this question but I am really stuck on this part. Basically, I am trying to align my github stats side by side in the readme file.

I added this code in my readme file:


![User GitHub Stats](https://github-readme-stats.vercel.app/api?username=user&show_icons=true&theme=radical)
![Top Languages Card](https://github-readme-stats.vercel.app/api/top-langs/?username=user&theme=radical&layout=compact)

How can I make it so that the two cards align side by side? Something like this:

enter image description here

Any suggestions?

UPDATE:

I tried adding this but it still did not work:

<img align="center" src="https://github-readme-stats.vercel.app/api?username=hussaino03&show_icons=true&theme=radical" />
 <img align="center" src="https://github-readme-stats.vercel.app/api/top-langs/?username=hussaino03&theme=radical&layout=compact" />

enter image description here


<div style="display: flex; flex-direction: row;">
 <img class="img" src="https://github-readme-stats.vercel.app/api?username=hussaino03&show_icons=true&theme=radical" />
 <img class="img" src="https://github-readme-stats.vercel.app/api/top-langs/?username=hussaino03&theme=radical&layout=compact" />
</div>
  • Either `display: flex;` or `float` the elements. Please include your HTML and CSS if you want a relevant solution. – Kameron Nov 23 '21 at 00:18
  • Here is a similar question: https://stackoverflow.com/questions/24319505/how-can-one-display-images-side-by-side-in-a-github-readme-md You might find out your answer there. – CleverUser123 Nov 23 '21 at 00:20
  • yes, but isnt it different with readme stats? –  Nov 23 '21 at 00:21
  • I edited my question with what I tried –  Nov 23 '21 at 00:23
  • I'm almost certain all sorts of styling are filtered out here for reasons of sanitization, so there's probably not a way to do what you want. – bk2204 Nov 23 '21 at 02:19

1 Answers1

1

Please see the CSS I added and changes to your HTML. Simply doing <img align="center" is not enough.

<div style="display: flex; flex-direction: row;">
 <img class="img" src="https://github-readme-stats.vercel.app/api?username=hussaino03&show_icons=true&theme=radical" />
 <img class="img" src="https://github-readme-stats.vercel.app/api/top-langs/?username=hussaino03&theme=radical&layout=compact" />
</div>

Inspected front-end and changed div styles to those suggested and it worked as expected. img

Kameron
  • 7,250
  • 3
  • 6
  • 22