关于< p> [英] About <p>

查看:118
本文介绍了关于< p>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道< pshould是否会包含在贬值的html标签列表中。

据我所知,它只不过是一个< ;后跟一个

< br /它有一个很大的缺点,即<强制执行以下

空白行,这通常不是你想写的。不能以最明显的方式,不能产生对话,例如:


xxxxx yyyyyyy zzzzzzzzz aaaaaaaaaa

b ccccccccc dddddddd eeeeeeeeeee

ffffffff gggggggg hhhhhh iiiiiiiiiii

jjjjjjjjj kkkkkkkkkkk lllllllll mmmmm

nnnnnnnnnnn oooooooo ppppppppppp

qqqqqqqqqqqq rrrrrrrrrr


sssssssss ttttttttttt uuuuuuu vvvvvvv

wwwwwwwwww


....使用< p>< / ptags围绕前三段。 < div>< / div>

但是有一些CSS包括说,text-indent:2em;对于第二个

两个< div> s很容易做到。


那么< p>?的故事是什么?它只是一个遗产吗?标签,还是那个

别的东西?

问候,

Kent Feiler
www.KentFeiler.com

解决方案

Kent Feiler写道:


我想知道是否< pshould包含在贬值的html标签列表中。

据我所知,它是'只不过是一个< div跟随一个

< br /它有一个很大的缺点,即<强制执行以下

空行,这通常不是你想要的书面。



它没有。使用css,就没有''空行''。如果您没有手动定义边距,那么在大多数浏览器中只是默认

渲染。在

普通文本中,段落之间的''空行''非常常见,因此

默认。如果你想改变它(我不会):你可以自由地改变它。


A< pis显然是更好的选择,因为它说明了什么样的满足它

持有。 A< divis匿名,可以保留任何内容。


...在前三段使用< p>< / ptags。 < div>< / div>

但是有一些CSS包括说,text-indent:2em;对于第二个

两个< div> s很容易做到。



好​​吧:

p {保证金:0}

p + p {text-indent:2em;}


没问题(如果MSIE了解sibliung选择器...)

-

Rik Wasmus


2006年12月14日星期四20:40:51 -0600,Kent Feiler< zz ** @ zzzz.comwrote:


>
我想知道< pshould是否会被包含在贬值的html标签列表中。
据我所知,它只不过是一个< divfollowed by
< ; br /并且它有一个很大的缺点,即<强制执行以下空白行,这通常不是你想写的。你不能,至少不是以明显的方式,产生对话,例如:


>那么'是什么'与< p>?的故事它只是一个遗产吗?标签,还是还有什么呢?



远非如此,实际上你已经很落后了。 P是一个语义上有意义的

标签,表示内容是段落。你需要对语义含义的概念进行一些研究。


另一方面,Div没有语义含义,仅仅是

设计为一个分组元素,用于包含样式的块元素和

定位目的。


标记内容时你不应该''担心它看起来的样子,但

这是意思。您将标记与样式分开。 HTML用于语义

标记,CSS用于样式。你对P的反对只是一个造型问题

问题 - 如果你不喜欢元素在浏览器中显示的方式,

样式它看起来你想要的样子它。


2006年12月14日星期四,Kent Feiler写道:


我想知道是否< pshould被列入贬值的html标签列表。

据我所知,它只不过是一个< divfollowed a

< br /> ;



非常正确!你应该使用HTML Compact或者更确切地说是具有div的
XHTML Compact。和跨度仅作为elem ^ W标签。


scnr



I wonder if <pshould be included in the list of devalued html tags.
As far as I can see it''s nothing more than a <divfollowed by a
<br /and it has the big disadvantage that <pforces a following
blank line which is often not what you want in writing. You can''t, at
least not in an obvious way, produce dialogue such as:

xxxxx yyyyyyy zzzzzzzzz aaaaaaaaaa
bb ccccccccc ddddddddd eeeeeeeeeee
ffffffff gggggggg hhhhhh iiiiiiiiiii
jjjjjjjjj kkkkkkkkkkk lllllllll mmmmm
nnnnnnnnnnn oooooooo ppppppppppp
qqqqqqqqqqqq rrrrrrrrrr

sssssssss ttttttttttt uuuuuuu vvvvvvv
wwwwwwwwww

....using <p></ptags around the first three paragraphs. <div></div>
however with some CSS including say, "text-indent:2em;" for the second
two <div>s does it easily.

So what''s the story with <p>? Is it just a "legacy" tag, or is there
something else?
Regards,
Kent Feiler
www.KentFeiler.com

解决方案

Kent Feiler wrote:

I wonder if <pshould be included in the list of devalued html tags.
As far as I can see it''s nothing more than a <divfollowed by a
<br /and it has the big disadvantage that <pforces a following
blank line which is often not what you want in writing.

It does not. Use css, and there will be no ''blank line''. It''s just default
rendering in most browsers if you haven''t defined the margins by hand. In
normal text, a ''blank line'' is very common between paragraphs, hence the
default. Should you wish to change it (I wouldn''t): you''re free to do so.

A <pis obviously the better choice, as it states what kind of content it
holds. A <divis anonymous, and could hold anything.

...using <p></ptags around the first three paragraphs. <div></div>
however with some CSS including say, "text-indent:2em;" for the second
two <div>s does it easily.


Well:
p {margin:0}
p + p {text-indent:2em;}

No problem (if MSIE understood sibliung selectors...)
--
Rik Wasmus


On Thu, 14 Dec 2006 20:40:51 -0600, Kent Feiler <zz**@zzzz.comwrote:

>
I wonder if <pshould be included in the list of devalued html tags.
As far as I can see it''s nothing more than a <divfollowed by a
<br /and it has the big disadvantage that <pforces a following
blank line which is often not what you want in writing. You can''t, at
least not in an obvious way, produce dialogue such as:

>So what''s the story with <p>? Is it just a "legacy" tag, or is there
something else?

Far from it, in fact you have it pretty well backward. P is a
semantically meaningful tag indicating the contents are a paragraph. You
need to do a little research on the idea of semantic meaningul html.

Div on the other hand has no semantic meaning as such and is merely
designed as a grouping element to contain block elements for stylein and
positioning purposes.

When marking up content you shouldn''t worry about the way it looks, but
it''s meaning. You separate markup from style. HTML is for semantic
markup and CSS is for styling. Your objection to P is merely a styling
issue - if you don''t like the way the element is displayed in browsers,
style it to look the way you want it.


On Thu, 14 Dec 2006, Kent Feiler wrote:

I wonder if <pshould be included in the list of devalued html tags.
As far as I can see it''s nothing more than a <divfollowed by a
<br />

Quite right! You should be using "HTML Compact" or rather
"XHTML Compact", which have "div" and "span" as only elem^W tags.

scnr


这篇关于关于&lt; p&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆