css - 水平滚动低于 1000 宽度

标签 css background scroll

我挣扎了几天,找到了一个似乎不起作用的解决方案。

无论如何,我想做的是在有人拖动窗口宽度小于 1000 像素 时“锁定”屏幕。我的意思是,嗯,水平滚动条必须出现并且背景图像必须停止调整大小并且文本必须停止移动。当达到 1000 像素以下以及文本时,背景必须水平滚动。

希望有人可以帮助我,现在已经尝试了两天:s

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Hup</title>


<style type="text/css">
html{

    background: url(jup.png) no-repeat center center fixed;
    min-width:500px;
    max-height: 500px;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size:auto 580px;
    background-position: center 120px;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='jup.png',     sizingMethod='scale');
    -ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='jup.png', sizingMethod='scale');
}

#menu {
    position:absolute;
    margin-top:80px;
    margin-left:20px;
    position:absolute;
right:20px;
}
.menu_container {
    width:500px;
    overflow:hidden;
    position:absolute;
    display:none;
    height:100px;
}
#bottom {
    position:absolute;
    margin-top:720px;
    position:absolute;
    left:20px;
    white-space: nowrap;
}
.bottom_container {
    width:500px;
    overflow:hidden;
    position:absolute;
    display:none;
    height:100px;

}
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000000;

}
body {
    min-width:1024px;
    background-color: #000;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
</style>
</head>

<body>

<div id="menu">
<div class="container">
Text here
</div>

</div>
<div id="bottom">
<div class="container">
Text here
</div>

</div>

</body>
</html>

最佳答案

简单:

body { min-width: 1000px; }

关于css - 水平滚动低于 1000 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15486016/

相关文章:

css - 如何使用 CSS 创建锯齿形横幅

jquery-ui - 滚动时 jQuery 可排序包含中断

css - Angular - 带滚动条的 slider

javascript - JS - 获取视口(viewport)中元素的百分比

jquery - 如何在 TD 中选择 IMG?

javascript - Canvas JS 上的墙壁检测

jquery - 根据列表大小调整 Bootstrap 菜单多列的大小

javascript - 如果视频正在加载(缓冲),则显示带有加载 GIF 图像的 HTML5 视频

css - 设置导航栏的背景图片 - bootstrap

iphone - 如何 "Auto SMS Sender"工作 - 在后台发送短信