[编辑: HTML无效,需要在Markdown处理器吐出后进行清理。感谢Jukka K. Korpela!]
我有一个p
元素嵌套在span
元素中,但是当我使用时
我在display: inline;
元素的css中p
,它似乎只有作用
间歇。
这是html:
<div class="item">
<a name="3">
<div class="image">
<img src="http://benjamingolder.com/media/images/portfolio/denver-installation_1.jpg" alt="Biennial of the Americas" />
</div>
</a>
<span class="name">Biennial of the Americas</span>
<span class="description"><span class="punct"> | </span> <p>To present the Local Code project at the <a href="http://www.biennialoftheamericas.org/artistsnicholas-de-monchaux.html">Biennial of the Americas</a> in Denver<span class="punct">,</span> Colorado<span class="punct">,</span> we constructed 225 site models from recycled doors<span class="punct">,</span> furniture<span class="punct">,</span> laser<span class="punct">-</span>cut acrylic<span class="punct">,</span> fur coats<span class="punct">,</span> and steel<span class="punct">.</span></p>
</span>
</div>
这是css:
.name {
font-style: italic;
}
.description, .projectdescription {
width: 496px;
}
.description p {
margin: 0;
display: inline;
}
以下是您可以查看其中的页面:
http://benjamingolder.com/portfolio/local-code/#3
当我用chrome检查它时,它说p元素具有属性
display: inline
但它仍将其显示为阻止。
在此页面上,相同的设置似乎正常工作:
http://benjamingolder.com/portfolio/rec-center/
如果我导航到有效的页面,那么返回到没有的页面 工作,突然它工作,即使我没有编辑css或HTML 所有
同样,有时失败,所以第一次查看时它实际上可以正常工作。 我真的很想知道它是否正在为其他人发生,如果他们能够发现的话 任何可能导致这种轻微差异的事情。
答案 0 :(得分:3)
HTML规则中p
内span
的标记无效,这可能会产生各种影响。首先修复标记。