【发布时间】:2021-01-29 02:18:18
【问题描述】:
我一直在通过使用最大宽度和最大高度属性来更改高度和宽度,以检查当显示屏幕尺寸变小时时图标布局是否会相应更改。但是,我一直无法得到我正在重新想象的结果。下面我有 HTML 代码,我有一个我正在尝试实现的链接。基本上如果屏幕太小,我宁愿每行有两个图标让它们正确间隔。如果 max-height 和 max-width 没有帮助,我应该如何实现这一点?我对带有标签的图标布局很好,因为如果屏幕尺寸足够大,只是想在屏幕较小时让它干净地显示出来。我的代码是一个较小的片段,它是下面故意的一部分。
.picture {
height: 32px;
width: 32px;
}
<a href="https://about.fb.com/k" ><img class="picture" src="https://img.icons8.com/ios/452/facebook-new.png" /><span style="padding-left:3px">Label 1</span></a>
<a class="social-link mr-2" href="https://about.fb.com/k"><img class="picture" src="https://img.icons8.com/ios/452/facebook-new.png" /><span style="padding-left:3px">Label 2</span></a> <a class="social-link mr-2" href="https://about.fb.com/k" target="_blank" rel="noopener noreferrer"><img class="picture" src="https://img.icons8.com/ios/452/facebook-new.png" /><span style="padding-left:3px">Label 3</span></a> <a class="social-link mr-2" href="https://about.fb.com/k" rel="noopener noreferrer"><img class="picture" src="https://img.icons8.com/ios/452/facebook-new.png"/><span style="padding-left:3px">Label 4</span></a>
【问题讨论】:
标签: html css responsive-design media-queries