Align image to top right inside a container - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Align

Description

Align image to top right inside a container

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
.wrapper {<!--from   w w  w .j a  v  a2s. c o  m-->
   border:2px solid Chartreuse;
   width:401px;
}

.p1 {
   font-size:37px;
   display:inline-block;
   margin:0;
   float:left;
   padding:0;
   width:51%;
}

.p2 {
   margin:0;
   display:inline-block;
   vertical-align:bottom;
   float:left;
   width:51%;
}

.p2 img {
   display:block;
}

.clear:after {
   content:"";
   display:table;
   clear:both;
}
</style> 
 </head> 
 <body translate="no"> 
  <div class="wrapper clear"> 
   <div class="p1">
     Lorem Ipsum is simply dummy text. 
   </div> 
   <div class="p2"> 
    <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials