为什么要消除< br>? [英] Why eliminate <br>?

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

问题描述

我在Eric Meyers的一本书中指出,他表达了使用CSS的一个目标是

来消除所有< brtags。为什么?

-

Ed Jay(删除''M''通过电子邮件回复)

I note in an Eric Meyers book that he expresses one goal of using CSS is
to eliminate all <brtags. Why?
--
Ed Jay (remove ''M'' to respond by email)

推荐答案

Ed Jay< ed *** @ aes-intl.comwrote:
Ed Jay <ed***@aes-intl.comwrote:

>我在Eric Meyers一书中注意到他表达了一个目标使用CSS是为了消除所有< brtags。
>I note in an Eric Meyers book that he expresses one goal of using CSS is
to eliminate all <brtags.



如果是这样,那么他就强烈要求。

If so then he is putting that to strongly.


>为什么?
>Why?



< bris一个元素几乎没有用,它经常被滥用到

插入空白行或伪段落当应该使用真正的段落标记

时,或者应该使用CSS边距时的间距,或者获得

元素以在元素之前和之后具有换行符

应设置为display:block;相反。


但是使用< br>有一些合法用途,一个例子是

在< addresselement中创建一个换行符:


< address>

我的名字< br>

我的地址

<地址>


-

Spartanicus

<bris an element with few appropriate uses, it''s often abused to
insert blank lines or "pseudo paragraphs" when real paragraph markup
should be used, or spacing when CSS margins should be used, or to get an
element to have a line break before and after for which the element
should be set to "display:block" instead.

But there are a few legitimate uses for using <br>, one example would be
to create a line break inside an <addresselement:

<address>
My name<br>
My address
<address>

--
Spartanicus


Spartanicus写道:
Spartanicus scribed:

> Ed Jay< ed *** @ aes-intl.comwrote:
>Ed Jay <ed***@aes-intl.comwrote:

>>我注意到了Eric Meyers预定他表达了使用CSS的一个目标是消除所有< brtags。
>>I note in an Eric Meyers book that he expresses one goal of using CSS is
to eliminate all <brtags.


如果是这样,那么他就强烈要求。


If so then he is putting that to strongly.


>>为什么?
>>Why?


< bris一个没有适当用途的元素,它经常被滥用来插入空行或伪段落。当应该使用真正的段落标记时,或者应该使用CSS边距时的间距,或者要使
元素在前后换行时将元素
设置为"显示:块"相反。

但是有一些使用< br>的合法用途,一个例子是
在< addresselement中创建一个换行符:
< address>
我的名字< br>
我的地址
< address>


<bris an element with few appropriate uses, it''s often abused to
insert blank lines or "pseudo paragraphs" when real paragraph markup
should be used, or spacing when CSS margins should be used, or to get an
element to have a line break before and after for which the element
should be set to "display:block" instead.

But there are a few legitimate uses for using <br>, one example would be
to create a line break inside an <addresselement:

<address>
My name<br>
My address
<address>



谢谢。

-

Ed Jay(删除''M''通过电子邮件回复)

Thanks.
--
Ed Jay (remove ''M'' to respond by email)


Ed Jay< ed *** @ aes-intl.comscripsit:
Ed Jay <ed***@aes-intl.comscripsit:

我注意到了Eric Meyers预订
I note in an Eric Meyers book



哪本书?请引用标题和页面。

Which book? Please cite by title and page.


他表达了使用CSS的一个目标

是消除所有< brtags。为什么?
that he expresses one goal of using CSS
is to eliminate all <brtags. Why?



你的意思是他没有在书中解释这一点吗?


我想Eric指的是使用中的常见滥用连续< brtags到

创建垂直间距。这是笨拙,粗糙和不可靠的,所以肯定它应该用CSS代替



此外,甚至合法使用< brcan经常被其他标记取代,

通常< div>,这可能有助于造型。


消除所有< brtags听起来像是一种误解但是。不管是埃里克的错误构想还是你的错误,这都是不可能的。


-

Jukka K. Korpela(Yucca)
http:// www .cs.tut.fi / ~jkorpela /

Do you mean he does not explain that in the book?

I guess Eric refers to the common abuse of using successive <brtags to
create vertical spacing. That''s clumsy, coarse and unreliable, so surely it
should be replaced by the use of CSS.

Besides, even legitimate uses of <brcan often be replaced by other markup,
usually <div>, and this may help in styling.

Eliminating all <brtags sounds like a misconception, though. It''s
impossible to say whether it would be Eric''s misconception or yours.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


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

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