如何使用< hr>如何在CSS中添加多个水平线;元素?

发布于 2025-02-08 17:13:59 字数 422 浏览 2 评论 0原文

我已经成功添加了1个水平行,但是当我尝试添加另一个(通过使用HTML中的多个< hr>元素)时,它似乎不起作用。

HTML代码: < hr/>

CSS代码:

hr {   
   width: 90%;    
   height: 7px;    
   margin-left: 50px;    
   margin-right: auto; 
   background-color: #911637;    
   border: 0 none;    
   position: absolute;    
   top: 110px; 
   right: 85px;    
   left: 0px;    
   down: 0px;
}

I have already successfully added 1 horizontal line, but when I try to add another one (by using multiple <hr> elements in the HTML), it doesn't seem to work.

HTML Code:
<hr/>

CSS code:

hr {   
   width: 90%;    
   height: 7px;    
   margin-left: 50px;    
   margin-right: auto; 
   background-color: #911637;    
   border: 0 none;    
   position: absolute;    
   top: 110px; 
   right: 85px;    
   left: 0px;    
   down: 0px;
}

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

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

发布评论

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

评论(1

初相遇 2025-02-15 17:13:59

首先:,对于位置,使用top bottom bottom not 完成

第二:,第二个&lt; hr/&gt;未显示的原因是bcs,因为它使用了绝对位置

这是小型演示的链接,您可以在其中看到代码
codepen demo

first:, for position, use top right left and bottom not done

second:, the reason why the second <hr/> isn't showing is bcs it's on top of the first one, due to using absolute position

here is a link for small demo where you can see the code
codepen demo

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