gpt4 book ai didi

css - IE 7 中的无序列表

转载 作者:行者123 更新时间:2023-11-28 12:26:51 24 4
gpt4 key购买 nike

我在使以下页面在 IE 7 中正确显示时遇到了一些问题。它在 IE 8、Mozilla Firefox 和 Google Chrome 中工作正常。唯一的问题是在 IE 7 中,无序列表的宽度导致列表项不必要地换行到下一行。非常感谢任何帮助。

哦,我还注意到,通过注释掉下面设置某些元素宽度的两行,无序列表的问题就消失了。但是我没有让网页居中在浏览器中间,我需要...

无论如何,有没有什么方法可以使这个在 IE 7 中的显示方式与在 IE 8 中的显示方式相同?

<!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>
<title></title>
<style type="text/css">
*
{
font-family: Arial, Helvetica, Veranda, sans-serif;
padding: 0px;
margin: 0px;
}

#PageWrapper
{
width: 840px; /* Commenting out these two lines fixes the unordered list. */
margin-right: auto;
margin-left: auto;
font-size: 0.96em;
}


#MainContentWrapper
{
position: relative;
width: 800px; /* Commenting out these two lines fixes the unordered list. */
min-height: 400px;
margin-top: 10px;
margin-bottom: 20px;
padding: 20px;
background-color: White;
line-height: 1.2em;
}

/*
ol, ul
{
padding-left: 1.0em;
margin-left: 1.0em;
}
*/

.CategoryDetailsMCWrapper
{
clear: both;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 20px;
padding-top: 20px;
}

.CategoryDetailsWrapper
{
clear: both;
display: inline-block;
}

.EntryLabel
{
clear: left;
width: 130px;
float: left;
}

.EntryDataItem
{
float: left;
max-width: 570px;
margin-left: 0px;
padding-left: 20px;
border-left: 1px solid #AAAAAA;
}

.EntryRowBottomBorder
{
display: inline-block;
clear: left;
float: left;
border-bottom: 1px solid #AAAAAA;
}
</style>
</head>
<body>
<form method="post">
<div id="PageWrapper">
<div id="MainContentWrapper">
<div class="CategoryDetailsMCWrapper">
<h3>
Heading</h3>
<div class="CategoryDetailsWrapper">
<div class="EntryRowBottomBorder">
<div class="EntryLabel">
List 1:
</div>
<ul class="EntryDataItem">
<li>Different wavelengths of light that allow people to see. </li>
</ul>
</div>
<div class="EntryRowBottomBorder">
<div class="EntryLabel">
List 2:
</div>
<ul class="EntryDataItem">
<li>A rainbow has many colors. </li>
<li>Before movies had color, they were "black and white". </li>
</ul>
</div>
</div>
</div>
</div>
</div>
</form>
</body>
</html>

非常感谢!

安德鲁

最佳答案

最好给任何你想 float 的元素一个宽度。以 %age 或 unit 为单位。

一种方法是给父容器 100% 的宽度。请在此处查看工作示例:http://jsbin.com/uteko3/3

另一种方法是使用标签和元素的 %ages 重做布局。

我使用了确保最佳跨浏览器兼容性的 doctypetransitional 不会。

关于css - IE 7 中的无序列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3952064/

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