gpt4 book ai didi

html - 如何将同类元素垂直拉近

转载 作者:太空宇宙 更新时间:2023-11-04 05:48:23 26 4
gpt4 key购买 nike

如您所见,标志在垂直方向上相距太远,这在我缩小浏览器时会发生。

screen shot

我该如何解决这个问题?

.flag {
width: 15px;
height: 10px;
margin-top: 35px;
margin-bottom: 30px;
}
<input type="image" class="flag" src="flags/china-flag.pdf" href="#">
<input type="image" class="flag" src="flags/india-flag.pdf" href="#">
<input type="image" class="flag" src="flags/united-states-of-america-flag.pdf" href="#">
<input type="image" class="flag" src="flags/indonesia-flag.pdf" href="#">
<input type="image" class="flag" src="flags/pakistan-flag.pdf" href="#">
<input type="image" class="flag" src="flags/brazil-flag.pdf" href="#">

最佳答案

删除 margin-topmargin-bottom 属性。请参阅以下示例。

.flag {
width: 15px;
height: 10px;
}
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />

<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />

<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />

<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />

<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />

<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />

<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />
<input type="image" class="flag" src="/image/2uN67.png" href="#" />

关于html - 如何将同类元素垂直拉近,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58504347/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com