Thursday 19 July 2012

How to set Vertical alignment of an image inside text in css


<!DOCTYPE html>
<html>
<head>
<style type="text/css">
img.top {vertical-align:text-top;}
img.bottom {vertical-align:text-bottom;}
</style>
</head>

<body>
<p>An <img src="your logo.gif" alt="name" width="270" height="50" /> image with a default alignment.</p>
<p>An <img class="top" src="your logo.gif" alt="name" width="270" height="50" /> image with a text-top alignment.</p>
<p>An <img class="bottom" src="your logo.gif" alt="name" width="270" height="50" /> image with a text-bottom alignment.</p>
</body>
</html>

0 Responses to “How to set Vertical alignment of an image inside text in css”

Post a Comment