jquery-mobile - 如何在侧列中显示 ui 页面之外的背景图像
问题描述
我现在尝试将我的 jQuery Mobile 网站重用于智能手机,用于大屏幕。感谢这个论坛,我可以缩小主要内容列/空间,所以我认为它更容易阅读。但是现在两边都有一个空白空间,我想在其中显示背景图像。
我尝试使用 body 标签、ui-page 和 body.ui-mobile-viewport
我可以获得中间栏的背景,内容空间,不是我想要的,但两侧栏没有背景。
知道如何在侧栏中显示背景图像吗?
<style>
/* Breitenanpassung PC, width change fr pc */
@media only screen and (min-width: 64.1em){
.ui-page{
width: 45em !important;
margin: 0 auto !important;
position: relative !important;
border-right: 0.3em #666 outset !important;
border-left: 0.3em #666 outset !important;
background : url('http://beta.mondkalender-mobil.de/templates/Mondkalender-mobil/images/hintergrund_breit.gif');
}
</style>`
解决方案
您需要为整个文档设置背景body
,JQM 会注意为当前设置背景page
:
@media only screen and (min-width: 64.1em) {
.ui-page:not(.ui-dialog) {
width: 45em !important;
margin: 0 auto !important;
position: relative !important;
border-right: 0.3em #666 outset !important;
border-left: 0.3em #666 outset !important;
}
.ui-mobile-viewport {
background : url('http://beta.mondkalender-mobil.de/templates/Mondkalender-mobil/images/hintergrund_breit.gif');
}
}
推荐阅读
- video - 使用 WebVTT 在 YouTube 上定位字幕
- javascript - 是否可以通过 firestore collectionGroup 查询访问父文档字段
- javascript - React-Native 博览会 POST Blob
- python - How to send data from a child in mutiprocessing in python?
- vb.net - 使用 VB.NET 获取 sessionID 终端服务器(使用 .NET 框架)
- asp.net-core-3.1 - 功能管理 - 两个应用程序之间的内部缓存
- excel - 使用具有相同数据的多个选项卡的 VBA 或数据透视表创建表(不能 PowerPivot)
- javascript - 如何为属于夏令时的未来日期更正时区偏移
- draw - libreoffice Basic:绘图和表格形状:如何格式化单元格?
- javascript - 将 websocket ref 传递给子组件