Posted By

205804sw on 10/24/13


Tagged


Versions (?)

Unit 20 example HTML


 / Published in: HTML
 

This is an example of a div tag that makes use of CSS box styling.

  1. <!-- This code was created by Steven Winspear in 2013 -->
  2. <!-- This is a div tag. It has inline CSS to make 10 pixels of space between the content and the edge of the div -->
  3. <div style="padding: 10px; position: relative">
  4. <!-- This div tag is placed inside the first div. The margin-top attribute will move this div down 10 pixels from the top of the containing div. -->
  5. <div style="width:260px; height: 230px; float: right; margin-top: 20px;">
  6. <img src="images/about_us_1.jpg" width="250px" style="float: right;">
  7. </div>
  8. <p style="padding-right: 5px">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ut quam sit amet est sodales rutrum. Integer ligula risus, scelerisque sit amet fringilla at, pretium ut lorem. Vivamus auctor aliquam orci. Donec rhoncus sollicitudin ullamcorper. Nullam orci augue, ultrices sed massa vel, egestas varius augue. Morbi ornare, nisl a posuere faucibus, lacus nibh ultrices orci, et laoreet risus lacus ac neque. Donec iaculis vehicula purus. Vivamus sollicitudin porta risus, quis euismod enim fringilla in. Vivamus tempor egestas placerat. Nam quam massa, tempor quis ligula eu, pharetra adipiscing tortor. Nunc sodales tortor eu ullamcorper blandit. Fusce non odio urna. Pellentesque eleifend semper tortor. Donec mattis accumsan pulvinar. </p>
  9. <div style="width: 280px; float: left;">
  10. <img src="images/about_us_2.jpg" width="260px">
  11. </div>
  12. <p>Maecenas consequat nibh eget sollicitudin volutpat. Cras vel rutrum dolor. Nam tempor semper turpis, ut posuere dolor auctor sit amet. Proin lacus sem, pulvinar et purus in, blandit malesuada eros. Vestibulum vel ultricies enim. Fusce ut iaculis ligula. In pellentesque risus erat, vel consectetur eros mollis blandit. Nullam sed urna felis. Sed placerat vitae felis quis molestie. </p>
  13. </div>

Report this snippet  

You need to login to post a comment.