You can solve this by using a gambiarra:
#tudo{
font-size: 0;<<-------- esta
text-align: center;
margin: 0 auto;
}
#tudo {
font-size:0;
text-align: center;
margin: 0 auto;
}
.desktop {
display: block;
}
.img {
display: inline-block;
}
<div id="tudo">
<div class="desktop">
<div class="img">
<a href="https://www.google.com">
<img src="http://placehold.it/100x100"height="100%">
</a>
</div>
<div class="img">
<a href="https://www.google.com">
<img src="http://placehold.it/100x100"height="100%">
</a>
</div>
</div>
</div>
When we indent the code we leave some blanks, the inline-block
property will put that space between the elements.
For example, if I get your code without any change and put it inline
in the indentation it will also work, see:
#tudo {
text-align: center;
margin: 0 auto;
}
.desktop {
display: block;
}
.img {
display: inline-block;
}
<div id="tudo"><div class="desktop"><div class="img"><a href="https://www.google.com"><img src="http://placehold.it/100x100"height="100%"></a></div><div class="img"><a href="https://www.google.com"><img src="http://placehold.it/100x100"height="100%"></a></div></div></div>
So with space, the browser tells the element a default font size, since it has no character besides the space character, it is this default size, and assigning 0
to the font it has the 0
size. Dhaããrrrr
There are other ways to resolve this. See some