Solution 1 :

Hope this help 😀

h2 {
    overflow: hidden;
}

h2:after {
    content:"";
    display: inline-block;
    height: 0.5em;
    vertical-align: bottom;
    width: 100%;
    margin-right: -100%;
    margin-left: 10px;
    border-top: 1px solid black;
}
<h2>Featured products</h2>

Solution 2 :

You can easily achieve this with grid

.parent {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
}

 .line{
    background:black;
    height:1px
}
<div class="parent">
  <div>My some text</div>
  <div  class="line"></div>
</div>

Problem :

Question. sentence with half-line

In HTML / CSS.

like the picture uploaded, I wanna fill the blank space after some words with line.

the length of words can be changed.

If the full width is 1000px and the word is 100px-long, then half-line is 900px long.

And the word is 350px, then half-line is 650px-long.

How can I make it by CSS?

Let me know please..

Comments

Comment posted by Lalji Tadhani

Add you HTML & CSS code here

Comment posted by d5br5

wow legend.. thanks@@@

By