简体   繁体   English

如何在同一行第二对齐 <p> 段落

[英]how align in the same line two <p> paragrapher

I have two 我有两个

tags one inside the other. 在一个内部标记另一个。 The problem is that the 问题是

with name "bookmark_corrente_operazioni" is printed in the new line. 在新行中将打印名称为“ bookmark_corrente_operazioni”的文件。 So this is my code: 这是我的代码:

<p name="copia_operazione_spiegata"><b>Copia</b>: copia i post del bookmark corrente <p name="bookmark_corrente_operazioni">facebook</p>  e di copiarli in uno o più bookmarkk di destinazione</p>

and the result is: 结果是:

Copia: copia i post del bookmark corrente
facebook e di copiarli in uno o più bookmark

I want that the result is: 我希望结果是:

Copia: copia i post del bookmark corrente facebook e di copiarli in uno o più bookmark

Anyone can help me? 有人可以帮助我吗?

Instead of a second paragraph tag you can try using a span tag. 您可以尝试使用span标签来代替第二段标签。 It will be within the first paragraph tag and will not cause a line break. 它将位于第一段标记内,并且不会引起换行。

eg: 例如:

 <p name="copia_operazione_spiegata"><b>Copia</b>: copia i post del bookmark corrente <span name="bookmark_corrente_operazioni">facebook</span> e di copiarli in uno o più bookmarkk di destinazione</p> 

使用单个<p>标签或将<p>标签与<span>元素一起使用

 <p class="copia_operazione_spiegata"><b>Copia</b>: copia i post del bookmark corrente <span class="bookmark_corrente_operazioni">facebook</span> e di copiarli in uno o più bookmarkk di destinazione</p> 

is a block element which adds a new line in front of it. 是一个块元素,在其前面添加了新行。 is an inline element which should work better for you. 是一个内联元素,应该对您更好。

删除Facebook周围的p元素

Rather using p use span 而是使用p use span

<p name="copia_operazione_spiegata">
   <b>Copia</b>: copia i post del bookmark corrente 
   <span name="bookmark_corrente_operazioni">facebook</span>  
   e di copiarli in uno o più bookmarkk di destinazione
</p>

the question is why you'd want to nest paragraphs. 问题是为什么您要嵌套段落。 thats not a good idea. 那不是一个好主意。

instead use <span> for what you're trying to achieve. 而是使用<span>作为您要实现的目标。 <p> is a block element, which means it breaks into a new line after the block. <p>是一个块元素,这意味着它在该块之后会换行。

the cleanest solution: 最干净的解决方案:

<p name="copia_operazione_spiegata"><b>Copia</b>: copia i post del bookmark corrente <span name="bookmark_corrente_operazioni">facebook</span> e di copiarli in uno o più bookmarkk di destinazione</p>

that way, you have a wrapping paragraph around your text block, and inside, you have an inline element with <span> that doesn't break any rendering. 这样,您在文本块周围有一个换行段落,而在内部,有一个内联元素,带有<span>不会破坏任何渲染。 you can apply classes and attributes to it, without worrying it will change the appearance of your wrapping <p> 您可以对其应用类和属性,而不必担心它会改变包装的外观<p>

reason: 原因:

default value for "display" on <p> is "block". <p>上“ display”的默认值为“ block”。 default value for "display" on <span> is "inline". <span>上“ display”的默认值为“ inline”。

您可以使用无处指向的标签。

<a nome="bookmark_corrente_operazioni">facebook</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM