css中怎样在网页中间加一条横线?

关注者
34
被浏览
36,267

25 个回答

  1. border-bottom: 1px solid #000;
  2. <hr/>
  3. height: 1px; background-color: #000;
  4. box-shadow: 0 1px #000;
  5. <svg><line x1="0" y1="0" x2="200" y2="0" style="stroke:rgb(0,0,0);stroke-width:2" /></svg>
  6. <text>————</text>
  7. background: #000; padding: 1px;
  8. <image url="一条横线.jpg"></image>
  9. 表格. table背景#fff; body背景#000; 表格里就一列一行;

推荐一个技术导航网站 it1211.com

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>我是网页中的一条横线</title>

</head>

<body>


<h1>HTML</h1>

<p>下面是一条横线,想要看到我请运行vscode查看</p>


<hr>


<h1>CSS</h1>

<p>上面是一条横线</p>


</body>

</html>