您使用
吗?在你的 HTML 中?

发布于 2024-12-25 02:46:15 字数 283 浏览 1 评论 0原文

使用


在 HTML5 中仍然有效,但您认为它在语义上是正确的并且是内容的一部分吗?

您在项目中使用它吗?

我发现每次添加我们需要转到 html 代码的


时都很困难。使用 hr 将演示与内容混合在一起。

Wordpress WYSIWYG 编辑器没有


按钮,因此如果我使用它,那么如果添加/删除/重新组织内容,非技术客户将无法添加它。

Use of <hr> is still valid in HTML5 but do you think it's semantically correct and it's a part of content?

Are you using it in your projects?

I find it diffult when to add any <hr> we need to go to html code every time. using hr is mixing presentation with content.

Wordpress WYSIWYG editor doesn't have button for <hr> so if i use it then non technical client would not be able to add it if the add/remove/re-organize content.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

千柳 2025-01-01 02:46:15

是的 - 仍然使用它来分解长文本的部分 - 实际上不是为了其他任何事情。

如果在他们如此友善地结束您的问题后您仍然可以看到这一点 - 因为它实际上与 Wordpress 有关,而不是 HR 标签 - 这里有一个链接可能会帮助您解决问题。 (还有另一个我不知道的神秘 stackexchange。

https://wordpress.stackexchange.com/questions/6033/get-a-button-for-hr-in-the-editor

Yup - still use it for breaking up sections of long text - not for anything else really.

If you can still see this after they so kindly closed your question - as it's to do with Wordpress really and not HR tags - here's a link that might help you out of the problem. (and to yet another mystery stackexchange that I didn't know about.

https://wordpress.stackexchange.com/questions/6033/get-a-button-for-hr-in-the-editor

一个人的旅程 2025-01-01 02:46:15

我最近再次使用它,只是因为很容易理解其他开发人员阅读您的代码时发生的情况:

<h1>My title</h1>
<hr>
<p>My paragraph</p>

它仍然比其他任何东西都更像是一种样式。如果你想严格地将样式与(语义)标记分开,你可以考虑使用 CSS 中的 border-bottom 之类的东西。

我认为可读性很重要,而且即使在 HTML5 中,它也能正常工作。

话虽如此,我几乎根本不使用它。

I've been using this once again lately, simply because it is easy to understand what's going on for another developer reading your code:

<h1>My title</h1>
<hr>
<p>My paragraph</p>

It still is definitely more of a styling than anything else. If you want to be strict about separating style from (semantic) markup you could think of using something like with a border-bottom in CSS for example.

I think readability counts and that it works fine the way it does, even in HTML5.

That being said, I barely use it at all.

白云不回头 2025-01-01 02:46:15

是的,我认为在 html5 中使用 hr 是正确的,但仅在长文本中作为一种分页符。我永远不会使用 hr 来划分页面的功能不同部分。
对我来说,正确的用法是在 wiki 中,它主要基于文本,与最早的 html 页面非常相似。更重要的是,许多现代网站更喜欢较短的块甚至分页文本的设计,而 hr 标签似乎不再很有用。

Yes, I think it's correct to use hr in html5, but only in long texts as a kind of page-break. I would never use an hr to divide functionally different sections of the page.
For me, a proper use would be in a wiki, which is primarily text based in much the same way as the earliest html pages were. It's more that many modern sites favor a design with shorter blocks or even paged text that hr tags don't seem very useful anymore.

摘星┃星的人 2025-01-01 02:46:15

有趣的文章:http://html5doctor.com/small-hr-element/

我了解到


实际上意味着“一个部分的结束,另一个部分的开始”,这在语义上与

。因为像

这样的元素已经在本质上表明了这一点,所以


更多的是用于主题中断,例如在散文的一部分内或在场景之间分隔不同的主题在一本小说中。不过,您可以在任何可以使用

的地方使用它。

但无论如何我都不用它。

Interesting article: http://html5doctor.com/small-hr-element/

I learned <hr> actually means "end of one section, start of another", which is the same semantically as </section><section>. Because elements like <section> already indicate this intrinsically, <hr> is more for thematic breaks, such as separating different topics within a section of prose, or between scenes in a novel. However you can use it anywhere you can use a <p>.

but I don't use it anyway.

恬淡成诗 2025-01-01 02:46:15

如果您的内容中的主题或主题发生了变化,并且尚未用其他语义标记(标题或新部分),我会使用它。

I'd use it if there is a shift in topic or theme in your content that isn't already being marked by something else semantically (Heading or a new section).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文