我不能为我的生活弄清楚如何使div文本在段落文本旁边!像这样: ........段落文本段文本div文本div文本........ 我希望div成为下一段,就像它们在一个文本中一样。请帮助我!!
HTML:
<p><a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a>, <a href="#">paragraph text</a></p>
<div><a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>, <a href="#">div text</a>,</div>
CSS:
p {float:left;}
答案 0 :(得分:5)
只需使用
display = (
<section>
{
if (this.state.content.length >0)
{
this.state.content.map((item, i) => {
return <CardRenderer addPacks={true} key={i} container={item}/>
})
}
}
</section>
)