So, my website, on the homepage, has a "badge" that is fit to the container:
![[Image of my homepage.]](https://media2.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsuir08i0p7j8oc26jis2.png)
This is how it is set up:
<nav id="banner">
<img type="image/png" alt="[Image of Katty.]" src="/assets/images/Katty/emblem.png"/>
<!-- [...] -->
</nav>
However, on subpages, like /projects/index.html (https://calinzbaenen.github.io/projects/), there is some blank space between the "badge" and the end of the "banner":
![[Image of the Projects section of my website.]](https://media2.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhm5m7919jphohequzp0c.png)
This is how it is set up:
<nav id="banner">
<a draggable="false" tabindex="-1" href="/">
<img type="image/png" alt="[Image of Katty.]" src="/assets/images/Katty/emblem.png"/>
</a>
<h1>Projects</h1>
</nav>
From one of my stylesheets, I already have margin and padding set to 0 for them; their size is also fit-content.
ChatGPT recommended I make the <a> a display:block; element; I tried that, and it did not work. After I reported that, ChatGPT recommended I make the <a> have display:inline-block; and the <img> display:block;; after that did not work, I stopped trying to consult the AI.
I'm using Firefox 113.0.1 (64-bit) on Ubuntu x86_64.
Cheers!
Top comments (5)
I tried to change some css and found a fix
Just add this rule in
common.cssYou can change margin according to your needs
marginis set to 0, as I stated in my post.I like the solution, but it seems a bit hacky; is this solution not prone to breaking/working differently on different devices?
I don't think so that it would break, It looked good on my every device.