- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我一直在为一个聊天网站设计网站,但到目前为止,我所做的每一次尝试都以失败告终。我尝试用表格来做,它总是在一个浏览器(主要是 IE tho)、div 和更多浏览器中失败。
该网站必须是全屏的,最小宽度为 900 像素,最小高度为 500 像素,这样它就不会变小。我想在没有任何 javascript 的情况下执行此操作(我已经在 JS 中完成了,但这需要在没有它的情况下完成:<)
这是它应该是什么样子的图片。
我希望这在纯 CSS/HTML 中是可能的
提前致谢
编辑
我让它在 Firefox + Chrome 中工作,但 IE 决定不遵循任何规则...
<html>
<head>
<style type="text/css">
body{
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
}
</style>
</head>
<body>
<div style="height: 100%; width: 100%;">
<div style="position: relative; height: 100%; width: 100%; background-color: gray; min-width: 900px; min-height: 500px;">
<div style="position: absolute; height: 30px;left:0px; right: 300px ; background-color: yellow; bottom: 0;">
Input
</div>
<div style="position: absolute; height: 200px; width:300px; right: 0px; background-color: green; bottom: 0;">
ad
</div>
<div style="position: absolute; bottom: 200px; width:300px; right: 0px; top: 20px; background-color: blue;">
online
</div>
<div style="position: absolute; width:300px; right: 0px; top: 0px; height: 20px; background-color: red;">
online menu
</div>
<div style="position: absolute; right: 300px; top: 0px; left: 0px; height: 20px; background-color: yellow;">
tabs
</div>
</div>
</div>
</body>
</html>
最佳答案
好的,从你的问题中提取了几个问题;
首先,一个小提示:在大多数情况下,IE 中的 CSS 似乎与其他浏览器截然不同。为此,在属性前使用各种“IE Hack”符号之一(我使用 # 符号),使其仅适用于 IE。
例如:
html
{
background: #F00 ;
#background: #0F0 !important ;
}
将使所有浏览器显示红色背景,只有IE会显示绿色背景。
其次,为什么不使用 min-width
和 min-height
属性?它们与所有内容兼容(在 IE6 或更早版本中存在错误;查看 here 了解更多信息)并且总是和我一起玩这个把戏。将宽度和高度(显然)设置为 100%,所有这些都在 html 和 body 上(如下所示)
html, body {
width: 100% ;
height: 100% ;
min-width: 900px ;
min-height: 500px ;
}
至于其他方法,您可以尝试将整个 页面数据(从body 标签之后 开始)用一个div 包装起来(确保您将其保留为 block )以让它跨越整个页面。
另一个值得注意的注意事项是,如果您想要一个干净的全屏站点,您还应该将 overflow
属性应用于 html/body。如果您超出窗口的宽度,您将丢失内容,如果您选择移除滚动条,它将移除所有滚动条。
希望这对您有所帮助!
编辑:
在查看了您的新图片链接后,这很简单! :]
请记住,默认情况下 div 是 block 状的,以下应该可以工作(这是未经测试的,因此可能需要进行一些调整):
<body>
<div id="page">
<div id="right">
<div class="thirty">Top bar</div>
<div class="tall">Middle bar</div>
<div id="rt_bot">Bottom bar</div>
</div>
<div id="left">
<div class="thirty">Left Top Bar</div>
<div class="tall">Left Mid Bar</div>
<div id="lf_bot">Left Bottom Bar</div>
</div>
<div id="container"></div>
</div>
</body>
和CSS:
html, body {
width: 100% ;
height: 100% ;
min-height: 500px ;
min-width: 900px ;
margin: 0px ;
}
div#page {
height: 100% ;
}
div#right {
float: right ;
height: 100% ;
width: 300px ;
}
div#rt_bot {
height: 200px ;
}
div#left {
float: left ;
}
.thirty {
height: 30px ;
}
.tall {
height: 100% ;
}
div#lf_bot {
height: 50px ;
}
关于html - CSS/HTML 中的全屏网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4349567/
我正在尝试使用 Qt 制作游戏,因为它太棒了 ;) 而且您可以免费获得所需的所有东西。唯一的问题是更改系统分辨率和设置 QWidget(或 QGLWidget)“真正的”全屏。 你们中有人成功地做到了
有没有办法以全屏模式(没有工具栏、导航)启动 gwt-app? 我只找到了打开新窗口的提示: Window.open("SOMEURL","SOMETITLE", "fullscreen=yes
if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscr
我想解释一下我现在在做什么。我开发了一个 aar(sdk) 并且运行良好。但是,我希望我的 sdk 在被调用时占据全屏,即使调用者有一个工具栏。我尝试了此链接中的示例 [ How to set act
我是 Blazor 的新手,我正在尝试了解如何以全屏模式打开浏览器。我知道我可以执行 Javascript 中断并运行 Javascript,但这违背了 Blazor 的目的。 如何在 Blazor
我正在创建一个全屏应用程序,并且想知道是否有某种方法可以使 NSAlert 位于我创建的 CGDisplayCapture 之上。现在,NSAlert 显示在显示捕获后面。我的主窗口显示得很好(在使用
有人可以解释一下下面的代码是如何工作的吗? 元素指的是视频,全屏指的是页面上的链接。 我无法理解 if 语句 var element = document.getElementById('elemen
我想要实现的是类似于 Instagram 应用内网络浏览器,在您点击广告时使用: 我所做的是,我使用了 WebView bottomSheetDialogFragment,并覆盖了 onCreateD
第二个 ViewController 的顶部有这个空间,它几乎在手机上显示为可关闭的弹出窗口。如何使全屏显示(删除橙色箭头指向的空间)? 最佳答案 这是 iOS 13 的一项更改。用户将开始期望能够滑
我正在尝试在全屏模式下使用 emacs 并使用合适的字体。我有一台运行 Ubuntu 的基于 nvidia 的笔记本电脑。首次加载时,字体很大,认为是 16pt 字体。我使用菜单选项设置了合适的字体(
我有一个 GridView,我使用 BaseAdapter 来调整我的 GridView 中的图像和文本。我有一个问题,当我运行我的应用程序时,我的“GridView”有左、右、上和下边距。我不需要这
是否可以在全屏模式下使用 Android Studio 例如只有我们编码的那个字段应该显示在整个屏幕上。 像这样: 最佳答案 您可以使用“无干扰模式”: 关于全屏 Android Studio,我们在
我正在制作一个应用程序,当手机处于纵向时,我需要 fragment 显示菜单栏(带有设置快捷方式等),但当它处于横向时,我需要全屏。 因此,我有一个管理 2 个 fragment 的 Activity
我想知道是否可以在没有标签栏和导航栏的情况下全屏推送 NavigationController 的 ViewController。我的问题如下: 我的应用在 TabBarController 中嵌入了
我制作了一个1920 * 1048的flash(16:9的屏幕),并将其嵌入到html中喜欢: 问题是: 在 4:3 屏幕中,flash 的宽度为 100%,但顶部和底部有白色填充。看来闪光灯
我想制作一个同时包含多个文本的HTML5视频。 文本应该以不同的css布局(文本颜色、字体、阴影)显示在视频的不同位置(同时) 我试过这个教程http://www.artandlogic.com/bl
需要一些帮助。 我需要水平滑动一次长图像,然后再水平滑动回来...我在这里学习了一个教程 https://css-tricks.com/creating-a-css-sliding-backgroun
我正在制作一个简单的登录页面,并试图将以下图像作为背景全屏:image 我的 CSS 目前看起来像这样: body { background-image: url('/images/bg.jp
我想用透明色覆盖我的背景图片,但颜色没有覆盖背景图片。 这是我的演示: http://jsfiddle.net/farna/73kx2/ CSS 代码: .overlay{ backgroun
有什么方法可以隐藏状态栏并保持操作栏可见吗? 最佳答案 是的,有。您应该在 Activity 的 onCreate 方法中设置 FLAG_FULLSCREEN。 @Override public vo
我是一名优秀的程序员,十分优秀!