locked
How to add horizontal line with two words on same line as below? RRS feed

All replies

  • User288213138 posted

    Hi ahmedbarbary,

    According to your description, here is a demo for your reference.

    <span style="width: 400px">&nbsp;</span>Hi &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <span style="width: 400px">&nbsp;</span>Hi
    
    
    <style>
         span {
             display: inline-block;
             border-bottom: 1px solid black;
             line-height: 0;
             text-align:center            
         }      
    </style>

    The result:

    Best Regard,
    Sam

    Wednesday, July 24, 2019 5:50 AM
  • User-2054057000 posted

    Try this code:

    <div>
      <span>Word1</span>
      <hr style="float: left"/>
      <span>Word2</span>
    </div>

    Wednesday, July 24, 2019 9:18 AM
  • User-1151440187 posted

    For that i think you can add this css : 

    <h2><span>This is Title</span></h2>

    h2{

    width: 100%;
    text-align: center;
    border-bottom: 1px solid black;
    margin: 10px 0 20px;

    }

    h2 span{

    background: white;
    padding:10px 10px;

    }

    I think this will help you.smile

    Friday, March 27, 2020 5:20 AM