Align text to the right of an image using CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Alignment

Description

Align text to the right of an image using CSS

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">
img {<!--   ww  w . jav a  2 s .c  o  m-->
   display:inline-block;
}

.p1 {
   display:inline-block;
   width:301px;
   height:51px;
   top:41%;
   left:71%;
}
</style> 
 </head> 
 <body> 
  <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt="Diagram"> 
  <span class="p1">this is a test</span>  
 </body>
</html>

Related Tutorials