如何在< dt>之后不插入新行在< dl>中? [英] how to not insert a new line after <dt> in a <dl> ?

查看:90
本文介绍了如何在< dt>之后不插入新行在< dl>中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为浏览器默认情况下会这么做。你怎么能避免这种情况?


对于简短的定义而言,它看起来不是正确/漂亮,而且你怎么能不缩进整个< b $ b DD>所以这不是看起来像

这个:


< code>

_ _ _ term:def def def def def def ...

_ _ _ _ _ def def def def def def def ...

< / code>


它看起来像:


< code>

_ _ _ term:def def def def def def def ...

_ def def def def def def def def def def ...

< / code>


这是不会缩进整个def向右通过了这个词


谢谢

otf

I think browsers do it pretty much by default. How can you avoid that?

It just doesn''t look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>

it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>

That is it would not indent the whole def to the right passed the term

Thanks
otf

推荐答案

onetitfemme写道:


[主题:如何在< dt>之后不插入新行在一个< dl>?]
onetitfemme wrote:

[subjectline: How to not insert a new line after <dt> in a <dl>?]
我认为浏览器默认情况下会这么做。你怎么能避免这种情况?


在你的样式表中:

dt {float:left; clear:left;}

它只是看起来不看正确/漂亮的简短定义以及
如何不缩进整个< dd>所以,而不是看起来像这样:

< code>
_ _ _ term:def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
< / code>

它看起来像:

< code>
_ _ _ term:def def def def def def def ...
_ def def def def def def def def def def ...
< / code>

那是它不会缩小整个def向右通过术语


在你的样式表中:

dd {margin-left:0;}

谢谢
I think browsers do it pretty much by default. How can you avoid that?
In your stylesheet:
dt{float:left;clear:left;}
It just doesn''t look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>

it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>

That is it would not indent the whole def to the right passed the term
In your stylesheet:
dd{margin-left:0;}
Thanks




欢迎您:-)


-

Els http://locusmeus.com/

Sonhos vem。 Sonhos v?£。 O resto ?? imperfeito。

- Renato Russo -



You''re welcome :-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos v?£o. O resto ?? imperfeito.
- Renato Russo -


onetitfemme写道:
onetitfemme wrote:
我觉得浏览器做的很漂亮很默契。


浏览器做它几乎是默认的?关于做它的最奇怪的陈述之一

我见过。如果你不是说它,你应该指定

你的意思。 (注意:在邮件,文章,网页或任何内容的复制文本中引用标题

是不好的做法。)

你怎么能避免这种情况?


如果那个意味着在< dt>之后的新行,然后没有什么可以避免
。没有新的路线。只是一些边距或填充,这可能是一个未经训练的眼睛看起来像一条线,特别是如果你不支付

注意没有spoo的事实......我的意思是行。你有没有任何文字的

a行文字吗?


如果你的意思是垂直间距,即垂直边距或填充,

然后你肯定知道如何在CSS中使用它们。你到底是怎么回事?b $ b试试? URL?


另一方面,哪个浏览器使用默认的底部边距或填充

用于< dt>?你似乎是在寻求一个模糊描述的

不存在的问题的帮助。


或者你的意思是你甚至不想要一条线在< dt>之后休息,即你想让b $ b喜欢让定义从同一行开始?这很奇怪,

你粗略的例子不支持这个想法。


简单的答案是不要使用< dl> 这是最正确的,因为

大多数人在使用<时都没有_definitions_列表(即_terms_与

他们的_definitions_)。 dl> ;.

对于简短的定义而言,它看起来不是正确/漂亮,也不是如何不缩进整个< dd>所以,而不是看起来像这样:

< code>
_ _ _ term:def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
< / code>


好​​吧,它没有换行。问题是什么?什么是< code>

那里的东西?

看起来像:

< code>
_ _ _ term:def def def def def def def ...
_ def def def def def def def def def def ...
< / code>

那是它不会将整个def缩进到右边通过术语
I think browsers do it pretty much by default.
Browsers do "it" pretty much by default? One of the oddest statements
about doing "it" I''ve seen. If you didn''t mean "it", you should have
specified what you mean. (Note: it is bad practice to refer to a heading
in the copy text of a message, article, web page, or anything.)
How can you avoid that?
If "that" means means "a new line after <dt>", then there''s nothing to
be avoided. There is no new line. Just some margin or padding, which may
look like a line to an untrained eye, especially if you don''t pay
attention to the fact that there is no spoo... I mean line. Can you have
a line of text without any text?

If you mean the vertical spacing, i.e. the vertical margin or padding,
then surely you know how to work with them in CSS. What exactly did you
try? URL?

On the other hand, which browser uses a default bottom margin or padding
for <dt>? You seem to be asking for help with a vaguely described
problem that does not exist.

Or did you mean you don''t want even a line break after <dt>, i.e. you''d
like to have the definition start at the same line? That would be odd,
and your sketchy example does not support this idea.

The simple answer is "don''t use <dl>", and it''s mostly correct, since
mostly people have not got a list of _definitions_ (i.e., _terms_ with
their _definitions_) when they use <dl>.
It just doesn''t look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>
Well, it has no new line. What _is_ the problem? And what''s that <code>
stuff there?
it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>

That is it would not indent the whole def to the right passed the term




这太模糊了。你为什么不发布一个URL,并在默认的外观中(在某些浏览器上)确切地指定你要改变的内容是什么?


此外, < dl>元素被广泛滥用于混合名称/值对

,它不包含任何定义,它不是特别有用

语义。如果你添加观察到的事实,即它的默认渲染物

有特殊性并且很难用CSS调整,那么问题

出现了你使用它的原因。

仅使用例如


< p>< dfn>术语:< / dfn> def def def ...< / p>


可能是一个更好的起点。你不会有太多意想不到的和不可预测的默认渲染,你可以使用margin-left和

文本缩进的段落。当然你也可以使用< ul>

而不是< p>序列。元素,但如果定义很长,

简单段落可能更自然。



This is far too vague. Why don''t you post a URL and specify exactly what
you would like to change in the default appearance (on some browsers)?

Besides, the <dl> element is so widely abused for mixed name/value pairs
that contain no definitions whatsoever that it''s not particularly useful
semantically. If you add the observed fact that its default renderings
have idiosyncracies and are difficult to tune with CSS, the question
arises why you use it.

Using just e.g.

<p><dfn>Term:</dfn> def def def...</p>

might be a better starting point. You would not have much unexpected and
unpredictable default rendering, and you could play with margin-left and
text-indent for the paragraphs. Of course you could also use a <ul>
instead of a sequence of <p> elements, but if the definitions are long,
simple paragraphs might be more natural.


On Sun,2006年1月29日14:09:36 + 0100,onetitfemme

< on ************* @ yahoo.com>写道:
On Sun, 29 Jan 2006 14:09:36 +0100, onetitfemme
<on*************@yahoo.com> wrote:
它对于简短的定义看起来不是正确/漂亮,而且你怎么能不缩进整个< dd>所以,而不是看起来像这样:

< code>
_ _ _ term:def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
< / code>

它看起来像:

< code>
_ _ _ term:def def def def def def def ...
_ def def def def def def def def def def ...
< / code>
It just doesn''t look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>

it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>




我在

< URL:http://www.pretletters.net/_test/styling_definition_lists.html>中设置了一个示例(仅在Opera中测试过)。那个

可以帮到你。



-

______PretLetters:

|博客| http://www.pretletters.net/_private/weblog.html |

| webontwerp | http://www.pretletters.net/html/webontwerp.html |

| zweefvliegen | http://www.pretletters.net/html/vliegen.html |



I set up an example (only tested it in Opera) at
<URL:http://www.pretletters.net/_test/styling_definition_lists.html>. That
could help you.


--
______PretLetters:
| weblog | http://www.pretletters.net/_private/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |


这篇关于如何在&lt; dt&gt;之后不插入新行在&lt; dl&gt;中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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