Align image and 2 lines of text into the same line - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Alignment

Description

Align image and 2 lines of text into the same line

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#overview {<!--   w w w  .  jav  a2s.c o  m-->
   width:351px;
   height:501px;
   font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;
}

#overview #header-collapse {
   height:51px;
   width:100%;
   background-color:Chartreuse;
   color:yellow;
   font-size:16px;
   line-height:51px;
   white-space:nowrap;
   -moz-border-radius:0px;
   -webkit-border-radius:4px 4px 0px 0px;
   border-radius:4px 4px 0px 0px;
   text-align:center;
}

#overview #body-list {
   background:blue;
   height:451px;
   overflow-y:auto;
   width:100%;
   border-radius:0px 0px 4px 4px;
   -webkit-border-radius:0px 0px 4px 4px;
   border-radius:0px 0px 4px 4px;
}

#overview #body-list a {
   text-decoration:none;
}

.list-item:hover {
   background-color:pink;
}

.list-item {
   display:flex;
   align-items:center;
   border-bottom:2px solid WhiteSmoke;
   height:81px;
   width:100%;
   padding-left:11px;
   -webkit-box-sizing:border-box;
   -moz-box-sizing:border-box;
   box-sizing:border-box;
   position:relative;
}

.list-item p {
   margin:0px;
}

.list-item #header-title {
   color:OrangeRed;
   font-size:21px;
   font-weight:401;
}

.list-item #subtitle {
   color:grey;
   opacity:0.7;
   font-size:14px;
}

.list-item #list-image {
   height:61px;
   width:61px;
   margin-right:11px;
   background-color:BlueViolet;
   -webkit-border-radius:31px;
   -moz-border-radius:31px;
   border-radius:31px;
}
</style> 
 </head> 
 <body> 
  <div id="overview"> 
   <div id="header-collapse"> 
    <h4> Oversigt </h4> 
   </div> 
   <div id="body-list"> 
    <a href="#"> 
     <div class="list-item"> 
      <div id="list-image"></div> 
      <div class="list-titles"> 
       <p id="header-title">Title</p> 
       <p id="subtitle">Subtitle</p> 
      </div> 
     </div> </a> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials