Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 还有一个两列div查询_Css_Html_Two Column Layout - Fatal编程技术网

Css 还有一个两列div查询

Css 还有一个两列div查询,css,html,two-column-layout,Css,Html,Two Column Layout,我想要的是一个两列的CSS布局,有一个固定的边栏(在右边),比如说300px宽,和一个流动的左手列,可以扩展到适合屏幕大小和高度,然后在左手列上提供一个垂直滚动条,如果内容需要的话 如果有人能帮助我,我将永远感激 这是我到目前为止所拥有的 <html> <head> <style type="text/css"> body {margin:0px;} #outer { overflow: hidden; width: 100%; height:6

我想要的是一个两列的CSS布局,有一个固定的边栏(在右边),比如说300px宽,和一个流动的左手列,可以扩展到适合屏幕大小和高度,然后在左手列上提供一个垂直滚动条,如果内容需要的话

如果有人能帮助我,我将永远感激

这是我到目前为止所拥有的

<html>
<head>
<style type="text/css">
body {margin:0px;}
#outer { 
  overflow: hidden;
  width: 100%;
  height:608px; 
  background: #ddd; 
} 

#inner1 { 
  float: right;/* Make this div as wide as its contents */ 
  width:300px;
  padding:10px;
  background: #fdd; 
} 

#inner2 { 
  overflow: hidden;/* Make this div take up the rest of the horizontal space, and no more */ 
  padding:10px;
  background: #ddf; 

#divScroll { 
  overflow: scroll; 
  height:600px; 
} 
</style>
</head>
<body>

<div id="outer"> 
<div id="inner1"> 
    inner div 1. Some text... 
</div> 
<div id="inner2">
<div id="divScroll">

    inner div 2... <br />
    inner div 3... <br />
    inner div 2... <br />

.
.
    enough text here to make it scroll !
.
.
    inner div 2... <br />
    inner div 2... <br />
    inner div 2... <br />
    inner div 2... <br />
    </div>
</div> 
</div> 
</body>
</html>

正文{margin:0px;}
#外{
溢出:隐藏;
宽度:100%;
高度:608px;
背景:ddd;
} 
#inner1{
float:right;/*使此div与其内容一样宽*/
宽度:300px;
填充:10px;
背景:#fdd;
} 
#inner2{
溢出:隐藏;/*使此div占用剩余的水平空间,不再占用*/
填充:10px;
背景:#ddf;
#divScroll{
溢出:滚动;
高度:600px;
} 
内分区1。一些文本。。。
内部分区2…
内部分区3…
内部分区2…
. . 这里有足够的文本使其滚动! . . 内部分区2…
内部分区2…
内部分区2…
内部分区2…

对不起,我不能很好地理解这个问题, 这就是你想做的吗
不确定这是否是你的意思,但我认为你想要这样的东西:

将容器的溢出设置为隐藏,然后在每个div上添加负边距底部和相等的正填充底部

#container { overflow: hidden; }
#container div { float: left; background: #ccc; width: 200px; margin-bottom: -2000px; padding-bottom: 2000px; }
#container .col2 { background: #eee; }

<div id="container">
   <div>
        <p>Content 1</p>
   </div>
   <div class="col2">
        <p>Content 2</p>
        <p>Content 2</p>
        <p>Content 2</p>
        <p>Content 2</p>
   </div>
</div>
#容器{溢出:隐藏;}
#容器分区{浮动:左;背景:#ccc;宽度:200px;边距底部:-2000px;填充底部:2000px;}
#container.col2{背景:#eee;}
内容1

内容2

内容2

内容2

内容2


发布一些你说你已经尝试过的
[垃圾]
代码,并以此作为起点。此外,请花些时间回顾一下。欢迎来到。请。此问题和你之前的问题中已删除了“谢谢,蒂姆”。看看你是否正在寻找类似的内容。非常感谢!正是我想要的!