Vertical-align: baseline with image : img align « Tags « HTML / CSS






Vertical-align: baseline with image

     


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
<style type="text/css" media="Screen">
div {
  font-size: 60px;
  line-height: normal;
  border: 1px solid black;
}

* .text {
  font-size: 18px;
}

* .baseline {
  vertical-align: baseline;
}

</style>
</head>
<body>
<div>
    <img class="baseline" src="http://www.java2s.com/style/logo.png" alt="bar" />
    <span class="baseline text"> baseline</span> 
</div> 
</body>
</html>

   
    
    
    
  








Related examples in the same category

1.Image vertical align 20px
2.vertical align 100 percent image
3.vertical-align: text-bottom and image
4.image vertical align middle
5.image vertical align bottom
6.'align' specifies how the element is aligned with adjacent text