Align image vertically along baseline in HTML and CSS

Description

The following code shows how to align image vertically along baseline.

Example


<html>
<head>
<!--from  www  . ja  va2  s .co  m-->

<style rel="stylesheet" type="text/css">
p {
font: 12pt arial;
}

img.baseline {
vertical-align: baseline;
}
</style>
</head>

<body>
<p><img class="baseline" src="http://www.java2s.com/style/download.png"
alt="plane" width="74" height="74" />
The image is vertically aligned using the value baseline</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Align image vertically along baseline in HTML and CSS