问题的概况我观察到,当你在镀铬的星系上全屏显示一个div时,因为有了相机,就会有一个空白。我想有一些安全的空间,这样内容就能被充分显示.
我试着在全屏幕mdn文档上搜索,但是没有发现任何关于这个特定问题的信息。
有什么办法可以让我的div整个屏幕,包括那个黑色区域,或可能选择一种颜色?下面是我现在如何全屏显示我的div:
// fullscreen btn
document.querySelector(".fullscreen").onclick = function(){
if (window.innerHeight == screen.height) {
document.exitFullscreen();
} else {
document.querySelector(".app").requestFullscreen();
}
}下面是div和按钮的css:
*{
margin: 0;
padding: 0;
}
.app{
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background-color: crimson;
}
.fullscreen{
position: fixed;
top: 10px;
left: 10px;
height: 30px;
width: 30px;
background-color: burlywood;
}发布于 2022-08-17 21:17:12
我知道能不能看看你的HTML文件,这样我就可以在我的电脑上测试它,以便更好地理解这个问题。
但是如果您说div应该占据整个屏幕,那么请尝试
.fullscreen{
position: fixed;
top: 10px;
left: 10px;
height: 100%;
width: 100%;
background-color: burlywood;
}对不起如果我错了。如果它不起作用,那么考虑让我看看HTML文件。
https://stackoverflow.com/questions/73394682
复制相似问题