How do you shorten border length?

I am coding a website for a friend, and I want to shorten the length of a border. I found out that in CSS there is no “border-length” property. So how can I find a way to shorten the length of a border. here is an example
What my code is: title and long border under

What I want it to be:
(title)
------

A possible solution to your question:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <style>
      h1 {
        border-bottom: 1px solid gray;
        width: 100px;
        text-align: center;
      }
    </style>
  </head>
  <body>
    <h1>Title</h1>
  </body>
</html>