【发布时间】:2016-10-27 21:14:14
【问题描述】:
我对 HTML 有点生疏,我在测试站点的样式代码中遇到了问题。我在<h4> 标签后得到了一个非常奇怪的缩进,我不确定问题是什么。我将包含整个 div 和屏幕截图,以便更好地解决此问题。
div style="color: #777;background-color:white; text-align: justify; margin-left: 20px; margin-right: 20px;">
<h1 style= "text-align: center;"> My Experience</h1>
<span>
<h4 style= "text-align: right;">April 2014- Present</h4>
<h4>General Motors</h4>
<h5>Senior Program Manager</h5>
<p>
<ul>
<li>
End to end responsibility for the success of
the critical global IT projects that will evolve and transform
GM’s business processes and capabilities.
</li>
<li>
Management of the IT project life cycle from definition to deployment,
through engagement with senior GM leaders, cross-functional stakeholders,
and development teams
</li>
</ul>
</p>
<p>
<h4 style= "text-align: right;">May 2012- March 2014</h4>
<h4>Xtivia, INC</h4>
<h5>PMO Manager</h5>
<ul>
<li>
Provided direct leadership, organization and coordination to drive the delivery of complex portal implementations to customers in multiple sectors.
</li>
<li>
Guided project stakeholders in defining requirements, project scope and ensuring the effective utilization of team members.
</li>
<li>
Managed PMO’s functional activities, encompassing program planning, personnel management and product delivery.
</li>
</ul>
</p>
<h4 style = "float: left;">University of Nebrasksa - Omaha</h4><h4 style= "float: right;">June 2010 - Present</h4>
</br>
<h5>Adjunct Professor</h5>
<p>
Instructor for undergraduate Project Management and Cyber Ethics courses.
</p>
<span><h4 style= "float: left;">Bellevue University</h4><h4 style= "float: right;">June 2010 - Present</h4></span>
<br>
<h5>Adjunct Professor</h5>
<p>
Instructor for graduate and undergraduate Computer Information Systems and Management Information Systems courses.
</p>
</span>
我确定这很简单,但是就像我之前说的,我生疏了:)
【问题讨论】:
-
好吧,您的代码在语义上完全错误(我只是说这与手头的问题无关)。
-
第一:停止使用内联样式,使用样式表允许缓存。其次,如果你浮动一些东西,你会把它从文档的正常流程中拿出来——有时——这会吓坏后续的兄弟姐妹。我猜
<h5>可能会从clear: both中受益。顺便说一下,要详细说明之前的评论:您正在显示事物的列表,请使用列表。 -
你应该阅读语义。好的,快速回顾一下:页面上有一个
<h1>,其他所有内容都是其中的一个小节。 (通常<h1>是页面标题/徽标等)。然后是<h2>,然后是<h3>within 带有<h2>的容器。标题是后代,不用于它们通常在大小方面的外观。此外,您还奇怪地使用了<span>来包含一些标题,并使用浮点数、右对齐等有点随意。 -
您有一堆 HTML 错误,这意味着您的 DOM 可能看起来不像您期望的那样。使用验证器:validator.w3.org/nu
-
为什么我会因为提问而被扣分?