Advertisement
Lio-code

05 - CSS : sélecteurs et propriétés

Mar 8th, 2020
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Catch'em all!</title>
  6. <link rel="stylesheet" href="style.css">
  7. </head>
  8. <body>
  9. <main>
  10. <img class="hover-effect" src="http://images.innoveduc.fr/integration_parcours/css/css_selectors_props/hobbit-house.jpg" alt="Hobbit house">
  11.  
  12. <p>Photo by conner Bowe on Unsplash</p>
  13.  
  14. <img src="http://images.innoveduc.fr/integration_parcours/css/css_selectors_props/hobbit-house-grass.jpg" alt="Hobbit house with grass">
  15.  
  16. <p>Photo by Jeff Finley on Unsplash</p>
  17.  
  18. <img class="hover-effect" src="http://images.innoveduc.fr/integration_parcours/css/css_selectors_props/hobbit-house-grey-grass.jpg" alt="Hobbit house with grey grass">
  19.  
  20. <p>Photo by Tyler Lastovich on Unsplash</p>
  21. </main>
  22. </body>
  23. </html>
  24.  
  25. ----------------------------------------------------------------------------------------------------------------------------
  26. CSS:
  27. body {
  28. font-family: 'Courier New', Courier, monospace;
  29. }
  30.  
  31. /* English : Replace the dots below by a selector targeting all the images of the page. */
  32.  
  33.  
  34. img {
  35. width: 300px;
  36. height: 300px;
  37. border-radius: 1em; /* English : Replace with a property that makes the image borders look rounded. */
  38.  
  39. }
  40.  
  41.  
  42.  
  43. /* English : Replace the dots below by a class named "hover-effect" with a :hover pseudo-class. This class has to target the first image and the last image of the page. */
  44.  
  45.  
  46. .hover-effect:hover{
  47. opacity : 0.8; /* English : Replace with a property responsible for opacity changes. */
  48.  
  49. cursor: pointer;
  50.  
  51. }
  52.  
  53. /* English : Replace the dots below by a selector targeting the second image of the page. Do not use a class or an id! */
  54.  
  55. img:nth-of-type(2) {
  56. filter: grayscale(100%); /* English : Replace with a property that makes the image look black & white. */
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement