Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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的奇怪行为,刷新后修复_Css_Positioning_Browser Refresh - Fatal编程技术网

css的奇怪行为,刷新后修复

css的奇怪行为,刷新后修复,css,positioning,browser-refresh,Css,Positioning,Browser Refresh,我正在尝试构建一个页面,用户可以在其中浏览某些flash游戏,并为它们创建缩略图。一开始它们工作得很好,但当我点击一个游戏,然后返回浏览页面时, 文本与图像一致,当我刷新时,它变为ok 错误版本:(返回后) 右版本:(在开始和刷新后) 没有运行JavaScript,因此我不会更改元素的样式。有问题的有如下css代码: div.game_side_texts { clear:right; float:top; max-height:80%; } img.gamethumb { height

我正在尝试构建一个页面,用户可以在其中浏览某些flash游戏,并为它们创建缩略图。一开始它们工作得很好,但当我点击一个游戏,然后返回浏览页面时, 文本与图像一致,当我刷新时,它变为ok

错误版本:(返回后)

右版本:(在开始和刷新后)

没有运行JavaScript,因此我不会更改元素的样式。有问题的
有如下css代码:

div.game_side_texts
{
clear:right;
float:top; 
max-height:80%;
}

img.gamethumb
{
height:80%;
}

div.game_img_div
{
float:left;
margin-right:2%;
min-width:30%;
}

.game_thumbnail_div /* the div that contains everything */
{
float:left;

width:40%;
height:20%;

margin-top:6%;
margin-right:1%;

padding-bottom:3%;
}

那么问题出在哪里呢?提前谢谢

对于初学者来说,
.game\u thumbnail\u div
的宽度和高度都太小了。拆下它们或使尺寸至少为286 x 140。而且,
float:top
没有任何作用。我知道你提到你试过了,而且成功了,但我保证你不需要


也请发布您的HTML。另外,如果您可以创建一个JSFIDLE来复制这个问题,那就太好了。最后的办法是链接到你的网站。乍一看:根本没有浮动:顶部@watson从逻辑上讲,这是一个非常有用的属性(嗯
float:bottom
)。@OP你的问题很可能与
宽度:40%有关
.game\u thumbnail\u div
上,但你应该做一个JSFIDLE(谷歌搜索)让我确认一下。@watson我正要问“float:top做什么?”谢谢你的澄清!