使跨度位于P的最后一行

时间:2014-07-04 07:54:43

标签: html css

我目前正在制作布局。 我需要将一个外部span元素放到p

的最后一行
<p>I am here I am here I am here I am here I am here I am here </p><span>same line of the last line of paragraph </span>

是否有任何CSS属性可以存档?

2 个答案:

答案 0 :(得分:1)

将此css应用于p代码

p{
 display:inline-block;
}

工作代码:JSFIDDLE

答案 1 :(得分:1)

p{
 display:inline-block;
}

p{
    float:left;
    margin:0;
    padding:0;
}
如果p元素长于一行,

将不起作用。我推荐

p{
display: inline;
}
相关问题