Align text under an image using flexbox - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Align

Description

Align text under an image using flexbox

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">

.project {<!--from  w  ww  .  java2s.  c om-->
   display: flex;
   justify-content: center;
   flex-direction: column;
}
.project1 {
   height: 10rem;
   width: auto;
   border: 5px solid rgba(52, 73, 94, 1);
}
.project1info {
   background: rgba(52, 73, 94, 1);
   text-align: center;
}


      </style> 
 </head> 
 <body> 
  <div class="panel"> 
   <h1 class="subHead">Some Projects I Have Worked On</h1> 
   <h2 class="description"></h2> 
  </div> 
  <div class="project"> 
   <a href="https://hidden-brook-12046.herokuapp.com/" class="project1"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> </a> 
   <p class="project1info"> Featuring allows a user to search a musical artist and view a list of collaboraters they have worked with. </p> 
  </div>  
 </body>
</html>

Related Tutorials