Make Flexbox with image on the left and long paragraph to the right - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex

Description

Make Flexbox with image on the left and long paragraph to the right

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width"> 
  <style>
body {<!--from   ww  w .ja  v  a2 s  . c om-->
   background:Chartreuse;
}

h1 {
   padding-left:21px;
}

.text {
   font-size:13px;
   font-family:serif;
   text-align:center;
}
</style> 
  <style>
img {
   position:absolute;
   height:100%;
   left:51%;
   transform:translateX(-51%);
}

.figure, .text {
   position:relative;
   width:51%;
   overflow:hidden;
   float:left;
}

.article {
   display:flex;
   min-height:281px;
   max-width:691px;
   background:white;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <div class="article"> 
    <div class="figure"> 
     <img src="https://www.java2s.com/style/demo/Opera.png"> 
    </div> 
    <div class="text"> 
     <span class="cat">Lifestyle</span> 
     <h1> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </h1> 
     <span class="date">6. 6. 1966</span> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials