2014-10-18 68 views
0

我只是不能让那些左边的固定div响应。 3个div:| fixed | |中| |固定|这3个div是在一个div中。 如果即将进入全尺寸窗口,他们正在完美地工作,但是当我缩小窗口的大小时,它将所有东西都拧紧。 我不知道如何解决 - 我的中心div工作完美,响应和中心。 但左侧和右侧固定不会有反应。 我想解决方案是连接到固定div的响应宽度..任何想法? 我增加JSFIDDLE例如用于您的方便:CSS -align 3响应​​式分区 - 左侧位置固定,中心正常

这是如下结构:

<div> 

<div **fixed** left>  <img>              </div> 
<div **normal** center>  2 divs for left and right inside the center div  </div> 
<div **fixed** right>                </div> 

</div> 

REAL HTML:

<div id="div_header"> 
    <div class="cloumn right" id="div_right"><img src="http://placehold.it/250x600"></div> 
    <div class="cloumn center" id="div_center"> 
     <div id="inside_center"> 
      <div class="left_side" id="left_inside_center"> 


      </div> 
      <div class="right_side" id="right_inside_center"> 
       <h1> headline </h1> 
       <img src="http://img-9gag-lol.9cache.com/photo/a7KwPAr_460s.jpg"> 
      </div> 
     </div> 
     </div> 


    <div class="cloumn left" id="div_left"><img src="http://placehold.it/250x600"></div> 
</div> 
</div> 

REAL CSS:

body { 
    margin-top: 0 !important; 
    direction: rtl; 
} 

#right_inside_center img { 
    width: 97%; 
    margin-top: 7px; 
} 
#left_inside_center { 
    float:left; 
    width:inherit; 
} 
#right_inside_center { 
    float:right; 
    width:65%; 
} 
#inside_center { 
    height: auto; 
    overflow: hidden; 

} 

#div_header { 
    text-align: center; 
    display: table; 
    width: 100%; 
    table-layout: fixed; 
} 
.cloumn { 
    display: table-cell; 
} 
.center { 
    background:green; 

    height: 1500px; 
    width: 60%; 
} 
.left { 

    position: fixed; 
    width: 18%; 
} 
.right { 

    position: fixed; 
    width: 18%; 
} 
+0

你可以让它更清楚你想要做什么?这里显然有很多的努力,但我无法弄清楚你想要的结果是什么。 – ArtOfCode 2014-10-18 16:10:09

+0

我认为你正在寻找这个http://jsfiddle.net/victor_007/qwxoj8k2/2/ – 2014-10-18 16:25:43

+0

@VitorinoFernandes OMG你是我的上帝!谢谢,你可以上传答案,让我可以upvote? – 2014-10-18 17:32:31

回答

0

设定的宽度图像到100%将适合图像我n中的父母和做了一些小的改动的左width,右

JS Fiddle

+0

完美解决方案!我希望我可以upvote,但我的repoutation糟糕大声笑 – 2014-10-18 18:22:55

0

嗨巴里,你可以使用CSS的引导工作框架...

http://www.getbootstrap.com

这是非常容易使用。 ..

如果你需要更多关于引导程序的细节去官方网站。