0

我只在 IE8 中遇到奇怪的身高问题

http://www.jobs-apollo.com/job/details/San-Francisco-CA/EnrollmentMarketing/national-advisor-workforce-solutions-10845/

我不知道为什么,但每个段落的底部都有一个额外的换行符。有人可以调查这个问题并帮助我看看为什么会这样吗?

谢谢

4

2 回答 2

1

跨度不是布置内容的好方法,尤其是当您需要在它们上放置边距和填充时。

一方面,span 是一个“内联”元素,不应在其上放置边距或填充,因为内联元素旨在显示在“行”上而不是块级元素上,这会导致自动换行他们是关闭的。

http://www.impressivewebs.com/difference-block-inline-css/

如果可以的话,您应该将您的 html 修复为如下所示,因为它在语义上更正确,并且不太可能在旧浏览器中中断。您可能还需要考虑在您的

标签而不是边距,因为我发现 IE 中的边距比填充更挑剔。

                <p id="HRS_SCH_PSTDSC_DESCRLONG$0" class="PSLONGEDITBOX">Apollo Group, Inc. was founded in 1973 in response to a gradual shift in higher education demographics from a student population dominated by youth to one in which approximately half the students are adults and over 80 percent of whom work full-time. Apollo's founder, John Sperling, believed -- and events proved him right -- that lifelong employment with a single employer would be replaced by lifelong learning and employment with a variety of employers. Lifelong learning requires an institution dedicated solely to the education of working adults.</p>
                <p>Today, Apollo Group, Inc., through its subsidiaries, University of Phoenix, Apollo Global, College for Financial Planning, and Institute for Professional Development, has established itself as a leading provider of higher education programs for working adults by focusing on servicing the needs of the working adult. Apollo Group is the largest education service provider in North America and has the world's largest educational social network. Apollo is building state of art learning platforms in creating a virtual and highly engaging learning experience. The learning platforms which are built as a cloud based (Education-as-a-Service) bring a more scientific and social approach to the learning experience. We are changing the way people learn and interact via advanced, scalable learning solutions.</p>
                <strong>Subsidiary Statement</strong></p>

此外,在任何使用“b”标签表示粗体的地方,都应将其替换为“strong”,因为“b”标签已被弃用。这也可能是您的问题的一部分,因为标签上可能隐藏了 IE 正在使用的固有样式。

一旦你改进你的代码使其更符合标准,你可能会发现它工作得更好。我无法在 Firefox 中看到导致问题的确切原因,但我怀疑这些带有边距和 br 标签以及不推荐使用的“b”标签的跨度对您的情况没有帮助。

最后也是最重要的是,您需要修复实际上位于容器 div 内部的额外 doctype 和 head 标签。这肯定会导致一些问题:

在此处输入图像描述

于 2013-06-21T23:22:33.783 回答
0

是的,您的问题是您使用<span>标签来划分段落。对段落使用<p>(paragraph) 标签。这可能会解决所有问题。你可以通过在你的 CSS 中<span>加入你的部分来解决你的一些问题:display:block

span.PSLONGEDITBOX {
  display: block;
}

这将修复一些奇怪的悬挂最后一行。但我不相信它会解决所有问题。

正确的解决方法是完全消除所有这些<span><br>元素。如果您正确使用<p>for 段落,并<h1>通过<h5>for 标题,您将永远不需要手动插入 a <br>,或者至少很少插入。不要<b>在标题中使用标签。这不是他们的目的。

PS:这在 IE9 和 IE10 中也被破坏了。

于 2013-06-21T23:34:18.153 回答