标题和< br> s [英] headers and <br>s

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

问题描述

早些时候,讨论了为什么不过多地使用< br> s。我ñ
大多不喜欢使用< br> s但是有一种情况

它似乎比替代品更好。


< h4>这是段落标题< / h4>

< p>这是段落< / p>


如果我想在标题和段落之间没有边距,我可以使用:

< h4 class =' 'no_bottom_margin''>这是段落标题< / h4>

< p class =''no_top_margin''>这是段落< / p>


但这有时比讨价还价更令人讨厌


< p>

< span class =''paragraphheader''>这是段落标题< / span>

< br>

这是段落< / p>


你会怎么做?

Earlier, there was a discussion of why not to use <br>s too much. I
mostly don''t like using <br>s at all but there is one situation where
its seems better than the alternative.

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class=''no_bottom_margin''> this is the paragraph header</h4>
<p class=''no_top_margin''> this is the paragraph</p>

But this is sometimes more obnoxious than

<p>
<span class=''paragraphheader''>this is the paragraph header</span>
<br>
this is the paragraph</p>

How would you do this ?

推荐答案

meltedown写道:
meltedown wrote:

< h4>这是段落标题< / h4>
< p>这是段落< / p>

如果我想在标题和段落之间没有边距,我可以使用:
< h4 class =''no_bottom_margin''>这是段落标题< / h4>
< p class =''no_top_margin''>这是段落< / p>

但这有时比讨价还价更令人讨厌吗?令人讨厌?为什么?

< p>
< span class =''paragraphheader''>这是段落标题< / span>
< br>
这是段落< / p>

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class=''no_bottom_margin''> this is the paragraph header</h4>
<p class=''no_top_margin''> this is the paragraph</p>

But this is sometimes more obnoxious than
"Obnoxious?" Why?
<p>
<span class=''paragraphheader''>this is the paragraph header</span>
<br>
this is the paragraph</p>



这会从您的内容中删除有用的标记。标题只是一个

修改后的正文文本形式,而不是非视觉浏览器可以处理。

更改标题样式不会影响该文本样式增加你的文字/>
维护负担。

您是否随机使用无间隙演示文稿?或者它是否倾向于聚集在一起?
嘿嘿!您可以使用除法并级联h4和p元素,因此不需要

显式类属性。


-

jmm(连字符)列表(at)sohnen-moe(点)com

(删除电子邮件的.AXSPAMGN)


This removes useful markup from your content. The header becomes just a
modified form of body text and less for non-visual browsers to process.
And changing header styles does not affect that text style increasing your
maintenance burden.
Do you use the gapless presentation randomly? Or does it tend to clump
together?
Hey! You could use a division and cascade the h4 and p elements so no
explicit class attribute is required.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


曾几何时* meltedown *写道:
Once upon a time *meltedown* wrote:
早些时候,讨论了为什么不使用< br> s太多。我根本不喜欢使用< br> s,但有一种情况,它似乎比替代品更好。

< h4>这是段落标题< / h4>
< p>这是段落< / p>

如果我想在标题和段落之间没有边距,我可以使用:
< h4 class =''no_bottom_margin''>这是段落标题< / h4>
< p class =''no_top_margin''>这是段落< / p>

但这有时比

< p>
< span class =''paragraphheader''>更令人讨厌;这是段落标题< / span>
< br>
这是段落< / p>

你会怎么做?
Earlier, there was a discussion of why not to use <br>s too much. I
mostly don''t like using <br>s at all but there is one situation where
its seems better than the alternative.

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class=''no_bottom_margin''> this is the paragraph header</h4>
<p class=''no_top_margin''> this is the paragraph</p>

But this is sometimes more obnoxious than

<p>
<span class=''paragraphheader''>this is the paragraph header</span>
<br>
this is the paragraph</p>

How would you do this ?




如果该标题和段落是一个例子,则不同于其他

paragraps和< h4>网站上的标题,然后我只使用< h4

style =" blablabla">和< p style =" blabla">


但我总是尝试在

样式表文件中为所有标题标记提供自己的样式,例如h1 {margin-bottom:12px;}等等。较小的边距

较小(子)标题并在整个网站上使用它们相同的方式。


对于段落标记,我主要设置上边距到0px并且只使用

底部边距在下一段之前留出空格。这样我就可以有一个标题和一个跟随我喜欢的边距的段落。


-

/ Arne

- *当天的笑话* ----------------------------------- -----

技术支持:您使用什么反病毒程序?

客户:Netscape。

技术支持:那个'这不是一个反病毒程序。

客户:哦,对不起...... Internet Explorer。

-------------- -----------------------------------------------



If that header and paragraph is an exeption, different from other
paragraps and <h4> headers on the site, then I use just <h4
style="blablabla"> and <p style="blabla">

But I always try to give all header tags their own style, in the
stylesheet file, e.g. h1 {margin-bottom:12px;} and so on. Less margin
for smaller (sub)headers and use them the same way all over the site.

For the paragraph tag, I mostly set top-margin to "0px" and only use a
bottom-margin to make a space before the next paragraph. That way I
can have a header and a following paragraph with the margins I like.

--
/Arne
-- *Joke of the day* ----------------------------------------
Tech Support: What anti-virus program do you use?
Customer: Netscape.
Tech Support: That''s not an anti-virus program.
Customer: Oh, sorry...Internet Explorer.
-------------------------------------------------------------


Jim Moe写道:
Jim Moe wrote:
meltedown写道:
meltedown wrote:

< h4>这是段落标题< / h4>
< p>这是段落< / p>

如果我想在标题和段落之间没有边距,我可以使用:
< h4 class =''no_bottom_margin''>这是段落标题< / h4>
< p class =''no_top_margin''>这是段落< / p>

但这有时比令人讨厌的令人讨厌的更令人讨厌?为什么?

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class=''no_bottom_margin''> this is the paragraph header</h4>
<p class=''no_top_margin''> this is the paragraph</p>

But this is sometimes more obnoxious than
"Obnoxious?" Why?




只是将所有这些类添加到标签是一件苦差事。我会这样做

而不是使用< br>'(似乎我放弃了对我的文本的控制权

什么都不是在块元素中)。我只是觉得可能有一个我没想过的
a快捷方式。



Just that adding all those classes to the tags is a chore. I''ll do it
rather than using <br>''s (it seems like I''m giving up control of my text
when anything is not in a block element). I just thought there might be
a shortcut I hadn''t thought of.

< p>
< span class =''paragraphheader''>这是段落标题< / span>
< br>
这是段落< / p>
<p>
<span class=''paragraphheader''>this is the paragraph header</span>
<br>
this is the paragraph</p>


这删除了有用的标记来自您的内容。标题只是一种修改后的正文文本形式,对于非可视化浏览器来说更少。更改标题样式不会影响该文本样式
增加您的维护负担。
您是否随机使用无间隙演示文稿?或者它是否倾向于聚集在一起?
嘿!您可以使用除法并级联h4和p元素,因此不需要显式类属性。


This removes useful markup from your content. The header becomes just
a modified form of body text and less for non-visual browsers to
process. And changing header styles does not affect that text style
increasing your maintenance burden.
Do you use the gapless presentation randomly? Or does it tend to clump
together?
Hey! You could use a division and cascade the h4 and p elements so no
explicit class attribute is required.




我想如果所有段落都是那样,但是

总是比标题旁边的段落更多。所有

标题都是一样的,所以它至少会减少引用

标题类的需要。



I guess that could work if all the paragraphs were that way, but there
are always more paragraphs below the one next to the header. All the
header are the same so it would at least cut down on the need to cite
header classes.


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

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