div与CSS属性显示:table-cell闪烁

时间:2013-08-12 16:13:25

标签: php html css css-float css-tables

无论我做什么,我都没有在加载时得到div的闪烁。

我在content div内有三个主要的div。它们是left, right and middle div,在middle div内部,我动态创建了菜单,我希望将宽度均分为适合中间div。

CSS

#content{
    width: 1000px;
    display: table;
}
#left, #right, #middle{
    float: none;
    vertical-align: top;
    display: table-cell;
}
#left, #right{
    width: 200px;
}
#middle{
    width: 600px;
    min-width: 600px;
}

.. HTML

<div id="content">
   <div id="left">very less text and images in this cell</div>
   <div id="middle" style="<?php echo $middleWidth;?>">I have lot lots of images, hyperlinks and text in this page</div>
   <div id="right">very less text and images in this cell</div>
</div>

PHP

<?php
   //some calculations..
   $middleWidth = '602'.'px'; 
   //this value is dynamic, I might get from 600px to any value that can be divided to get 0 remainder.
?>

当网站加载页面闪烁时,我可以看到中间内容的宽度为800px,即内容div的宽度减去左div的宽度。即使我给出min-widht,max-width,flickr也没有停止。

对我来说还有一个挑战是应该在IE上工作。

请帮帮我..

1 个答案:

答案 0 :(得分:0)

此语法不正确

<div id="content">
   <div id="left">very less text and images in this cell</left>
   <div id="middle" style="<?php echo $middleWidth;?>">I have lot lots of images, hyperlinks and text in this page</middle>
   <div id="right">very less text and images in this cell</right>
</div>

</left> </middle></right>无效html。只需正常关闭div </div>