Wrap text along with image : img « Tags « HTML / CSS






Wrap text along 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" dir="ltr" lang="en-US"
  xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style rel="stylesheet" type="text/css">

body {
 font-family: Arial, Helvetica, sans-serif;
 color: #666666;
 font-size: 12px;
 padding: 0; margin: 0;
 background: #eef1ed;
}
#wrapper {
 width: 770px;
 margin: 0 auto;
 border: 1px solid #eef1ed;
 background: url(images/forest.jpg) repeat-x bottom;
}
/* Begin Parent Left Column --------------------------------------------------------------------- */
#leftcolumn { 
 padding: 10px;
 display: inline; /* IE Fix */
 float: left;
 border-left: 1px dashed #ccc;
 border-right: 1px dashed #ccc;
 border-bottom: 1px dashed #ccc;
 border-right: 1px dashed #ccc;
 background-color: #fff;
}
#leftcolumn .logo {
 margin: 0px 0px 10px 0px;
 width: 180px;
 border: 1px dashed #ccc;
 background-color: #EEF1ED;
}
#leftcolumn .logo img { display: block; }
#leftcolumn .leftbox2 { /* Generic Box */
 margin: 0px 0px 10px 0px;
 border-top: 1px dashed #ccc;
}
/* Begin Left Navigation */
#leftcolumn ul.mainnav { 
 margin: 0px;
 padding: 0;
 list-style: none;
}
#leftcolumn ul.mainnav .heading {
 background-color: #9FAF9A;
 padding: 5px;
 color: #fff;
 font-size: 16px;
}
#leftcolumn ul.mainnav li { 
 border-bottom: 1px dashed #ccc;
 border-right: 1px dashed #ccc;
 border-left: 1px dashed #ccc;
}
#leftcolumn ul.mainnav li a:link, #leftcolumn ul.mainnav li a:visited{ 
 color: #333;
 background-color: #F9F9F9;
 text-decoration: none;
 padding: 5px;
 display: block;
}
#leftcolumn ul.mainnav li a:hover{ 
 display: block;
 background-color: #EEF1ED;
 text-decoration: none;
 padding: 5px;
}
/* End Left Navigation */
/* End Parent Left Column ----------------------------------------------------------------------- */


/* Begin Parent Right Column ----------------------------------------------------------------------- */
#rightcolumn {
 border-left: 1px dashed #ccc;
 border-right: 1px dashed #ccc;
 margin: 0 0 0 10px;
 display: inline; /* IE Fix */
 width: 514px;
 float: left;
 background-color: #fff;
}
#rightcolumn p.content {
border: 1px solid #fff;
 margin: 10px;
}
#rightcolumn p.content img {
 float: left;
 margin: 0px 10px 10px 0px;
}
#rightcolumn h1 {
 margin: 10px;
 padding: 3px 10px;
 border: 1px dashed #ccc;
 font-size: 24px;
 background: #EEF1ED;
}
#rightcolumn .banner {
 margin: 10px;
 border: 1px dashed #ccc;
 background-color: #EEF1ED;
}
#rightcolumn .banner img { display: block; }
/* End Parent Right Column ----------------------------------------------------------------------- */
.clear {
 clear: left;
}
#footer {
 background: #fff;
 border: 1px dashed #ccc;

}
#footer .text {
padding: 10px;
 margin: 0 auto;
 width: 710px;
 border: 1px solid #fff;
}
#footer .text a:link, #footer .text a:visited { color: #333; text-decoration: none; }
#footer .text a:hover {  color: #333; text-decoration: underline; }
#footer .text img { border: none ; }
</style>
</head>
<body>


   <!-- Begin Wrapper -->
   <div id="wrapper">
   
      <!-- Begin Left Column -->
    <div id="leftcolumn">
    
       <!-- Begin Logo -->
       <div class="logo">
        <img src="http://java2s.com/style/logo.png" alt="Code-Sucks.com - logo" />
     </div>
     <!-- End Logo -->
     
     <!-- Begin Left Box -->
       <div class="leftbox">
        <ul class="mainnav">
         <li class="heading">Heading One </li>
         <li><a href="#">Link Two</a></li>
         <li><a href="#">Link Three</a></li>
         <li><a href="#">Link Four</a></li>
         <li><a href="#">Link Five</a></li>
         <li><a href="#">Link Six</a></li>
         <li><a href="#">Link Seven</a></li>
         <li class="heading">Heading Two </li>
         <li><a href="#">Link Two</a></li>
         <li><a href="#">Link Three</a></li>
         <li><a href="#">Link Four</a></li>
         <li><a href="#">Link Five</a></li>
         <li><a href="#">Link Six</a></li>
         <li><a href="#">Link Seven</a></li>
      </ul>
     </div>
     <!-- End Second Left Box -->
    
    </div>
    <!-- End Left Column -->
    
    <!-- Begin Right Column -->
    <div id="rightcolumn">
    
       <!-- Begin Top Banner -->
       <div class="banner">
        <img src="http://java2s.com/style/logo.png" alt="Forest banner" />
     </div>
     <!-- End Top Banner -->
     
     <h1>Keith Donegan with Pale Forest </h1>
     <p class="content">
        <img src="http://java2s.com/style/logo.png" alt="Code-Sucks.com - Thumbnail" />Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque 
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
      <br /><br />
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
     </p>
     
     <h1>CSS / XHTML Strict Templates </h1>
     <p class="content">
        <img src="http://java2s.com/style/logo.png" alt="Code-Sucks.com - Thumbnail" />Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque 
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
      <br /><br />
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
     </p>
     
     <h1>CSS Layouts </h1>
     <p class="content">
        <img src="http://java2s.com/style/logo.png" alt="Code-Sucks.com - Thumbnail" />Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque 
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
      <br /><br />
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
     </p>
     
     <h1>Pale Forest </h1>
     <p class="content">
        <img src="http://java2s.com/style/logo.png" alt="Code-Sucks.com - Thumbnail" />Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque 
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
      <br /><br />
      laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi 
      architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas 
      sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione vol. 
     </p>
    
    </div>
    <!-- End Right Column -->
      
    <div class="clear"></div>
    
   </div>  
   <!-- End Wrapper -->
   
   <div id="footer">
      <p class="text">
         <a href="">Valid XHTML</a> &nbsp;<a href="">Valid CSS</a>Copyright </p>
   </div>


   
</body>

</html>

   
    
    
    
    
    
  








Related examples in the same category

1.Adding images and alt message with XHTML
2.Alternative Text Rendering
3.Set background to #fff for an image
4.Set padding to 4px
5.display block
6. in a
7.Set image margin top and left to negative value
8.Image block
9.image clear: left;
10.Switch image for link
11.Adding caption to Image
12.Image as a link
13.Creating an Image Map
14.Top link with image
15.Using arrow image for LI
16.Use image to create line
17.Using color image to create round corner
18.Large corner image for the top bar
19.Image slide show
20.Text wrap around image
21.Image side bar
22.Text wrap image
23.Using huge image to highlight your content
24.Using image to add shading to your text
25.Image Text wraper
26.Marginal Graphic Dropcap
27.Raised image
28.Lowered text
29.Image with clear left
30.Using css to wrap text around images
31.Image map area
32.HTML Image map
33.Creating and Using Image Maps
34.shape = "rect" indicates a rectangular area, with coordinates for the upper-left and lower-right corners
35.value "poly" creates a hotspot in the shape of a polygon, defined by coords
36.shape = "circle" indicates a circular area with the given center and radius
37. indicates that the specified image map is used with this image
38.Client-side Image Map Example
39.'area' defines the clickable area on a graphic or image
40.'coords' sets the coordinates of an 'a' or 'area' element
41.'galleryimg' eliminate the appearance of the toolbar for all 'img' elements
42.'img' displays a picture or a video clip
43.Adding shading to the picture
44.HTML code for image scaling
45.'ismap': Whether the image in 'img' element is a server-side image map
46.'lowsrc' gives the URL of a low-resolution image
47.'map' specifies the coordinates of an image map
48.'nohref' indicates that the 'area' in the 'map' has no link
49.'shape' sets the shape of an 'a' or 'area' element
50.'src' specifies a URL to be loaded by the element
51.'start' specifies when a video clip should start playing
52.'usemap' sets the image map for the map element
53.'hspace' sets the space in pixels between the left and right sides of an element
54.'vspace' sets the size in pixels of the vertical margins