gpt4 book ai didi

css - IE7 在同一个元素上 float 和清除

转载 作者:行者123 更新时间:2023-11-27 22:36:17 25 4
gpt4 key购买 nike

这是我的代码,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[your title]</title>
<style type="text/css">
.a, .b, .c
{
float: left;
}
.b
{
clear: left;
}
</style>
</head>
<body>
<div class="a">1</div>
<div class="b">2</div>
<div class="c">3</div>
</body>
</html>

在 IE8、firefox、chrome、safari、opera 中,输出将是:

1
23

但是在 IE7 中:

13
2

我已经搜索了两天的解决方案...有人可以提供帮助吗?

干杯,b长颈鹿

最佳答案

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[your title]</title>
<style type="text/css">
.a, .b, .c
{
float: left;
}
.b
{
clear: left;
}
</style>
</head>
<body>
<div class="a">1</div>
<div style="clear: left;"></div>
<div class="b">2</div>
<div class="c">3</div>
</body>

关于css - IE7 在同一个元素上 float 和清除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2467745/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com