我准备在我的页面上尖叫,感觉就像一场真正的战斗。我正在尝试为 html 应用程序获取完整的页面布局。我试图让两个主要的 div 并排,我可以用 js 隐藏。我在每个 div 中也有一个 44px 高的标题。我的问题是我似乎无法阻止大量内容流入第一个 div,即使隐藏了溢出等。我不能发布所有代码,但我应该能够发布相关部分。大部分代码与问题无关。我制作了一个JSfiddle只是为了让它更容易看到。提前致谢。哦,还有一些关于让我投票支持答案的技巧。不要试图改变列宽,我需要它们灵活的边界。提前致谢!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css" rel="stylesheet">
<title>Stack Overflow</title>
</head>
<body>
<div id="page-holder">
<div id="main-menu" class ="menu-width">
<div class="wide vert-center-right header large">
<div>
<input id="search" type="text" class="search"/>
<img class="visible-phone" src="css/images/logo.png" />
</div>
</div>
<div id="menu-body" class="menu-body">
<button class="wide small vert-center-left">Push Me</button>
</div>
</div>
<div id="main-view" class="view-width">
<div id="view-header" class="header view-header vert-align-left">
<a href="#" class="visible-phone" onclick="resized()"><img class="plain" src="css/images/header-icon-back-18x18.png"/></a>
<img src="css/images/header-logo.png" />
</div>
<div id="view-body" class="view-body">
Large block of text that I want to not wrap into menu column. Large block of
text that I want to not wrap into menu column. Large block of text that I want
to not wrap into menu column. Large block of text that I want to not wrap into
menu column. Large block of text that I want to not wrap into menu column.
Large block of text that I want to not wrap into menu column. Large block
of text that I want to not wrap into menu column. Large block of text that
I want to not wrap into menu column. Large block of text that I want to not
wrap into menu column. Large block of text that I want to not wrap into menu
column. Large block of text that I want to not wrap into menu column. Large
block of text that I want to not wrap into menu column. Large block of text
that I want to not wrap into menu column. Large block of text that I want to
not wrap into menu column. Large block of text that I want to not wrap into
menu column. Large block of text that I want to not wrap into menu column.
Large block of text that I want to not wrap into menu column.
</div>
</div>
<div style="clear:both"></div>
</div>
</body>
</html>