chirag satapara chirag satapara - 2 months ago 22
CSS Question

css to get desired output

I have tried below code to get desired output, how to display that lock in middle of that.I have tried so many thing , which i found on SO , but nothing is helpful to me.I have no much idea about the css.

I want to display like this:

enter image description here



.inline-block{
display:inline-block;
}

.lock_image{
width:30px;
height:30px;
}

hr{
width: 250px;
margin: 0px;
bottom: 1px;
margin-bottom: 5px !important;
margin-top: 5px !important;
}

.title{
margin:0px;
}

<div class="inline-block"><img src="https://image.ibb.co/f7sA2Q/icons8_Lock_50.png" alt="icons8_Lock_50" border="0" class="lock_image"></div>
<div class="inline-block"><p class="title">Google Drive Integrated Email</p><hr>
<a class="mgl20" href="javascript:void(0);">xyz@gmail.com</a>
</div>




Answer Source

I added a wrapper around the content you had and made it a flexbox with vertical center alignment.

.wrapper {
  display: flex;
  align-items: center;
}

.inline-block {
  display: inline-block;
}

.lock_image {
  width: 30px;
  height: 30px;
}

hr {
  width: 250px;
  margin: 0px;
  bottom: 1px;
  margin-bottom: 5px !important;
  margin-top: 5px !important;
}

.title {
  margin: 0px;
}
<div class="wrapper">
  <div class="inline-block">
    <img src="https://image.ibb.co/f7sA2Q/icons8_Lock_50.png" alt="icons8_Lock_50" border="0" class="lock_image">
  </div>
  <div class="inline-block">
    <p class="title">Google Drive Integrated Email</p>
    <hr>
    <a class="mgl20" href="javascript:void(0);">xyz@gmail.com</a>
  </div>
</div>