Vertical align of a container div inside unordered list element - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Alignment

Description

Vertical align of a container div inside unordered list element

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.0/normalize.min.css"> 
  <style id="compiled-css" type="text/css">
html {<!-- ww w .  j  a va  2  s.c  o  m-->
   font-size:2em;
}

body {
   background:Chartreuse;
   font-family:Verdana,Arial,sans-serif;
}

*, *:before, *:after {
   -moz-box-sizing:border-box;
   -webkit-box-sizing:border-box;
   box-sizing:border-box;
}

img {
   width:auto;
   max-width:100%;
   height:auto;
}

ul {
   list-style:none;
   padding:0;
}

ul li {
   margin-bottom:21px;
}

h1 {
   font-size:25px
}

p {
   font-size:19px
}

.container {
   width:1025px;
   margin-left:auto;
   margin-right:auto;
   background:yellow;
   padding:31px
}

ul li {
   font-size:0;
}

ul li>div {
   font-size:17px;
}

.slide-desc {
   width:36%;
   text-align:center;
   padding:11px;
}

.image-container {
   width:66%;
   text-align:right;
}

.slide-desc,
.image-container {
   display:inline-block;
   vertical-align:middle;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <ul> 
    <li> 
     <div class="slide-desc"> 
      <div class="slide-desc-in"> 
       <div class="slide-desc-bg"></div> 
       <div class="slide-desc-text"> 
        <div class="slide-title"> 
         <h1>Lorem ipsum dolor sit amet, conse</h1> 
        </div> 
        <div class="slide-text"> 
         <p>Lorem ipsum dolor sit a</p> 
        </div> 
       </div> 
      </div> 
     </div> 
     <div class="image-container"> 
      <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt="Respect, autonomie en privacy"> 
     </div> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials