我有一个全屏背景图片的网站。
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)
这显示了背景,但发生了同样的问题。
我一直在寻找在TIBASIC中创建一个程序,可以评估代码运行的计算器类型,无需汇编.因为我认为没有任何东西可以从关于屏幕获取信息.这是我提出的一段代码:
:ClrDraw
:Text(0,0,0
:PxlTest(6,1
Run Code Online (Sandbox Code Playgroud)
根据运行的计算器,这将有不同的输出.是否有类似性质的其他技巧,或者有更好的方法吗?
编辑:更新了代码中的代码
我有一张桌子,我需要填充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)我想<link>
在 HTML 头部中包含不同大小的各种图标的标签。<link>
在标签中排序图标的最佳实践是什么<head>
?我将它们包含在什么顺序中重要吗?最小到最大?从最大到最小?
我正在尝试使用 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
通常在此处提交代码时,我会尝试仅包含最少量的代码来演示问题。但是直到写完代码才遇到这个问题,几乎无法调试问题。
我有一段代码可以在一些不同类型之间转换文件。该代码可以正常运行,没有任何问题。它以 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) html ×3
css ×2
background ×1
favicon ×1
icons ×1
javascript ×1
meta ×1
permissions ×1
python-3.6 ×1
python-3.x ×1
python-os ×1
react-native ×1
reactjs ×1
shutil ×1
ti-basic ×1
typeerror ×1
typescript ×1