小编Jul*_*iet的帖子

在移动设备上滚动时,CSS 全屏背景在底部显示白条

我有一个全屏背景图片的网站。

html, body {
  height: 100vh;
}

html {
  background: url('/img/background.jpg') no-repeat center center fixed;
  background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)

此代码在大多数设备上运行良好,但在一些旧的 Android 设备上,向下滚动时会导致问题。部分向下滚动但不松开手指会显示一个与 URL 栏大小相同的白色栏,同时消失。一旦你松开手指,背景就会自行修复。

这就是图像在滚动中的样子。

网站截图

有没有办法确保背景总是填满页面?


编辑:我还尝试添加具有这些属性的 div:

#background {
  background: url('/img/background.jpg') no-repeat center center fixed;
  background-size: cover;
  z-index: -100;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200vh;
}
Run Code Online (Sandbox Code Playgroud)

这显示了背景,但发生了同样的问题。

html css background

6
推荐指数
1
解决办法
733
查看次数

检查TI-BASIC中的计算器类型

我一直在寻找在TIBASIC中创建一个程序,可以评估代码运行的计算器类型,无需汇编.因为我认为没有任何东西可以从关于屏幕获取信息.这是我提出的一段代码:

:ClrDraw
:Text(0,0,0
:PxlTest(6,1
Run Code Online (Sandbox Code Playgroud)

根据运行的计算器,这将有不同的输出.是否有类似性质的其他技巧,或者有更好的方法吗?

ti-basic

5
推荐指数
2
解决办法
110
查看次数

表不适合100%高度

编辑:更新了代码中的代码

我有一张桌子,我需要填充100%的高度并保持宽度与高度相同.我正在vh尝试实现这一目标.

index.html的:

var board = document.getElementById('board');
var draw = '';
var letters = 'abcdefgh';
var init = '????????????????                                ????????????????';
for (var column = 8; column > 0; column--) {
  draw += '<tr id="' + column + '" class="row">';
  for (var row = 0; row < 8; row++) {
    draw += '<td id="' + letters.charAt(row) + column + '" class="tile">' + init.charAt(row + 8 * column - 8) + '</td>';
  }
  draw += '</tr>';
}
board.innerHTML = draw; …
Run Code Online (Sandbox Code Playgroud)

html javascript css

5
推荐指数
1
解决办法
94
查看次数

在 HTML head 中排序图标 &lt;link&gt; 标签的最佳实践

我想<link>在 HTML 头部中包含不同大小的各种图标的标签。<link>在标签中排序图标的最佳实践是什么<head>?我将它们包含在什么顺序中重要吗?最小到最大?从最大到最小?

html meta favicon icons

5
推荐指数
1
解决办法
4464
查看次数

react-native-webview Typescript 错误:“WebView”无法用作 JSX 组件

我正在尝试使用 Expo 和 TypeScript 来设置一个简单的 React Native 应用程序,以显示 WebView。我的App.tsx文件包含以下内容:

import Constants from 'expo-constants';
import { StyleSheet } from 'react-native';
import { WebView } from 'react-native-webview';

export default function App() {
    return (
        <WebView
            style={styles.container}
            source={{ uri: 'https://example.com/' }}
        />
    );
}

const styles = StyleSheet.create({
    container: {
        marginTop: Constants.statusBarHeight,
    },
});
Run Code Online (Sandbox Code Playgroud)

此代码可以正常工作,但 TypeScript 编译器会在 WebView 组件中引发错误。

App.tsx:7:4 - error TS2786: 'WebView' cannot be used as a JSX component.
  Its instance type 'WebView<{ style: { marginTop: number; }; source: …
Run Code Online (Sandbox Code Playgroud)

typeerror typescript reactjs react-native react-native-webview

4
推荐指数
1
解决办法
2913
查看次数

Python3:文件正在被另一个进程使用

通常在此处提交代码时,我会尝试仅包含最少量的代码来演示问题。但是直到写完代码才遇到这个问题,几乎无法调试问题。

我有一段代码可以在一些不同类型之间转换文件。该代码可以正常运行,没有任何问题。它以 ZIP 文件中的 XCI 文件开头,然后将其转换为文件夹。然而,在代码的最后,我试图让我的脚本删除它创建的一些临时文件夹。这会导致一个有点令人困惑的错误,我无法成功地进行故障排除。

import os, shutil, zipfile
from shutil import copyfile
from time import sleep

for fileName in os.listdir("D:/start"):
    filePath = "D:/start" + fileName 
    os.makedirs("C:/Users/Julian/Documents/conversion/extract")

    copyfile(filePath, "C:/Users/Julian/Documents/conversion/extract/game.zip")

    print("Extracting C:/Users/Julian/Documents/conversion/extract/game.zip")
    zip_ref = zipfile.ZipFile("C:/Users/Julian/Documents/conversion/extract/game.zip", 'r')
    zip_ref.extractall("C:/Users/Julian/Documents/conversion/extract")
    zip_ref.close()

    for file in os.listdir("C:/Users/Julian/Documents/conversion/extract"):
        if file.endswith(".xci"):
            os.rename(os.path.join("C:/Users/Julian/Documents/conversion/extract", file), "C:/Users/Julian/Documents/conversionh/extract/game.xci")

    os.system("C:/Users/Julian/Documents/conversion/hactool/hactool.exe -t xci C:/Users/Julian/Documents/conversion/extract/game.xci --outdir=C:/Users/Julian/Documents/conversionh/extract")

    fileSizeTupleList = []
    largestSize = 0

    os.chdir("C:/Users/Julian/Documents/conversion/conversion/secure")
    for i in os.listdir(os.curdir):
        if os.path.isfile(i):
            fileSizeTupleList.append((i, os.path.getsize(i)))

    for fileName, fileSize in fileSizeTupleList:
        if fileSize > largestSize:
            largestSize = fileSize
            largestFile …
Run Code Online (Sandbox Code Playgroud)

permissions shutil python-3.x python-os python-3.6

3
推荐指数
1
解决办法
964
查看次数