Set image size and align images in one line - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Align

Description

Set image size and align images in one line

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#images {<!--from  w ww. j  a v a  2 s.  c om-->
   width:2001px;
}

#images img {
   width:301px;
   height:201px;
   float:left;
}
</style> 
 </head> 
 <body> 
  <div id="images"> 
   <a href="#1"> <img src="https://www.java2s.com/style/demo/Opera.png"> </a> 
   <a href="#2"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </a> 
   <a href="#3"> <img src="https://www.java2s.com/style/demo/Safari.png"> </a> 
   <a href="#4"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </a> 
   <a href="#5"> <img src="https://www.java2s.com/style/demo/Safari.png"> </a> 
   <a href="#6"> <img src="https://www.java2s.com/style/demo/Opera.png"> </a> 
  </div>  
 </body>
</html>

Related Tutorials