0

无论我做什么,加载时我的 div 都不会闪烁。

我在content 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 的宽度。即使我给出了最小宽度、最大宽度,flickr 也没有停止。

对我来说,另一个挑战是应该在 IE 上运行。

请帮我..

4

1 回答 1

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>

于 2013-08-12T16:17:53.743 回答