Text floating around image : img float « Tags « HTML / CSS






Text floating around image

     

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
#outer{
  width:50%;
  margin:auto;
  background:#ccc;
  border:1px solid #000;
  position:relative;
    overflow:auto;
}
#outer div  {
  position:absolute;
  bottom:0;
  left:0;
  margin-right:320px;
  width:100%;
}
#outer div p {
  margin-right:320px;
}
#outer img{
  float:right;
  margin:30px 10px
}

</style>
</head>
<body>
<div id="outer"> 
   <img src="http://www.java2s.com/style/logo.png" alt="" width="300" height="225" />
   <div><p>this is a test. this is a test. this is a test. this is a test. </p></div>
</div>
</body>

</html>

   
    
    
    
  








Related examples in the same category

1.Image float: left
2.Image float left, (text wrap)
3.Image floating left and right
4.Image floating right
5.Image floating with text
6.Image floating left
7.Image floating right 2
8.Image floating right, left
9.Floating the image allows the text to flow around it
10.Two image float left and right separately
11.Image floating to left
12.Image Floating right 3
13. floating to right with image
14.Image float and text wraping