Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of vertical alignment of an image</title> <style> p.one img{ vertical-align: top; } p.two img{ vertical-align: middle; } p.three img{ vertical-align: baseline; } </style> </head> <body> <p class="one">This image <img src="/examples/images/smiley.png" alt="Smiley"> is aligned vertically top of the text.</p> <p class="two">This image <img src="/examples/images/smiley.png" alt="Smiley"> is aligned vertically center of the text.</p> <p class="three">This image <img src="/examples/images/smiley.png" alt="Smiley"> is aligned to the baseline of the text.</p> </body> </html>