html - 在移动视图中正确显示页脚元素?
问题描述
我无法在移动屏幕尺寸的页脚中定位图像。它在浏览器中看起来很棒,但在移动端图像在底部被截断,并且版权在带有徽章的图像上方。
这是我在页脚主题自定义设置中的自定义 html 块中使用的 css:
<div>
<img src="https://cdn.shopify.com/s/files/1/0449/8210/8310/files/Sacred-Footer-layout-icons.jpg?v=1611374743"
style="position: relative;
right: 0px;
width: 400px;
padding: 0px;">
</div>
<div style="text-align: center !important;">
<small>
© 2021 Sacred Coffee Co.
</small>
</div>
这是我的网站网址https://sacredcoffeeco.com。谢谢你的帮助!
解决方案
使用代码,如果与现有 CSS 有任何冲突,请进行更改。
@media screen and ( max-width:749px ){
/* hide the last line and hr */
footer .page-width:last-child,.site-footer__hr {
display: none;
}
.site-footer__content {
height: auto;padding: 0;
}
.site-footer__item-inner.site-footer__item-inner--html_content {
display: flex;
flex-direction: column;
}
.site-footer__item-inner.site-footer__item-inner--html_content div:first-child {
order: 1;
}
}
推荐阅读
- swift - sqlite3 打开错误(macOS、swift5、Xcode 11.3.1)
- snowflake-cloud-data-platform - n 行的随机样本
- xamarin - XamarinUITest 将参数传递给 AndroidAppConfigurator
- python - 从列表的字典制作列表列表的字典
- angular - 动态 API 网址
- algorithm - 为什么贪心算法是启发式的,而不是元启发式的?
- assembly - 汇编中的内存at和ptr之间的区别
- java - 使用criteriaquery fetch 和createcriteria.setFechMode 的区别
- python - 在 pandas.Dataframe 中查找 NaN
- pandas - 如何从频率表创建箱线图