Align image in CSS to top - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Align image in CSS to top

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <style type="text/css">
img {<!--from  w w w .jav  a 2s  . c  o  m-->
   border: solid 2px black;
   vertical-align: text-top;
}
a {
   display: inline-block;
   font-family: curier;
}
p {
   vertical-align: text-top;
}

      </style> 
   </head> 
   <body> 
      <title>Biography</title> 
      <a href="#">Home</a> 
      <a href="#">Biography</a> 
      <a href="#">Campaign</a> 
      <a href="#">Political Platform</a> 
      <br> 
      <img src="http://java2s.com/resources/k.png" height="300" width="300" alt="alt message"> 
      <p>This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. </p>  
   </body>
</html>

Related Tutorials