html - Background color on only text -


the text in h3 dynamic , width of it's parent static , want manage in following way:

output need

.sh-link{     width:100%;     max-width: 200px;    }  .sh-link h3{     text-align: right;     background: orange;     color: #fff;     padding: 5px 10px;     border-radius: 4px;     display: inline; }      <div class="container">                   <div class="sh-link">         <h3>see details on dealer website</h3>       </div>     </div> 

can 1 me out?

.container {    width: 300px;    display: flex;  }    .left p,  .right p {    width: 100%;    background: orange;    color: white;    display: inline;  }    .left {    text-align: left;  }    .right {    text-align: right;  }    .separator {    background: white;    width: 20px;  }
<div class="container">    <div class="left"><p>see details on dealer website</p></div>    <div class="separator"></div>    <div class="right"><p>see details on dealer website</p></div>  </div>


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -