Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. .clearfix::after {
  6. content: "";
  7. clear: both;
  8. display: table;
  9. }
  10. div {
  11. width: 100%;
  12. margin: auto;
  13. background-color: hotpink;
  14.  
  15.  
  16. }
  17. .flimkh {
  18. background-color: maroon;
  19. margin: auto;
  20. width: 90%;
  21. }
  22. img{
  23. width: 300px;
  24. }
  25. .img1 {
  26. float: right;
  27. }
  28. .img2 {
  29.  
  30. }
  31. </style>
  32. </head>
  33. <body>
  34.  
  35. <h2>Center an Image</h2>
  36. <p>To center an image, set left and right margin to auto, and make it into a block element.</p>
  37. <div class="clearfix">
  38. <div class="flimkh clearfix">
  39. <img class="img1" src="paris.jpg" alt="Paris">
  40. <img class="img2" src="paris.jpg" alt="Paris">
  41. </div>
  42. </div>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement