Align image right top along with content - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Align

Description

Align image right top along with content

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">
div {<!--  w ww  .  j a  v a  2  s  . co m-->
   width:501px;
   min-height:100px;
   position:relative;
   text-align:justify;
}

img {
   width:100px;
   position:absolute;
   top:0;
   right:0;
}

p:first-child {
   max-width:401px;
}
</style> 
 </head> 
 <body> 
  <div> 
   <p>test test test test test test test test test test test test test test </p> 
   <p>test test test test test test test test test test test test test test </p> 
   <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
  </div>  
 </body>
</html>

Related Tutorials