Example of image alignment - HTML CSS HTML

HTML CSS examples for HTML:Image

Description

Example of image alignment

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head> 
  <title>Example image alignment</title> 
 </head> <!--from ww w  . j  ava2  s.com-->
 <body> 
  <p>This image <img src="http://java2s.com/resources/h.png" alt="Smiley" style="vertical-align: top;"> is aligned vertically top of the text.</p> 
  <p>This image <img src="http://java2s.com/resources/d.png" alt="Smiley" style="vertical-align: middle;"> is aligned vertically center of the text.</p> 
  <p>This image <img src="https://www.java2s.com/style/demo/Opera.png" alt="Smiley" style="vertical-align: baseline;"> is aligned to the baseline of the text.</p>   
 </body>
</html>

Related Tutorials