Advertisement
juliusDum

sélecteurs et propriétés jules

Mar 1st, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.72 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 src="http://images.innoveduc.fr/integration_parcours/css/css_selectors_props/hobbit-house.jpg" alt="Hobbit house">
  11.            <p>Photo by conner Bowe on Unsplash</p>
  12.            <img src="http://images.innoveduc.fr/integration_parcours/css/css_selectors_props/hobbit-house-grass.jpg" alt="Hobbit house with grass">
  13.            <p>Photo by Jeff Finley on Unsplash</p>
  14.            <img src="http://images.innoveduc.fr/integration_parcours/css/css_selectors_props/hobbit-house-grey-grass.jpg" alt="Hobbit house with grey grass">
  15.            <p>Photo by Tyler Lastovich on Unsplash</p>
  16.        </main>
  17.    </body>
  18. </html>
  19.  
  20. body {
  21.    font-family: 'Courier New', Courier, monospace;
  22. }
  23.  
  24. /* English : Replace the dots below by a selector targeting all the images of the page. */
  25. /* Français : Remplace les points ci-dessous par un sélecteur ciblant toutes les images de la page. */
  26.  
  27. img {
  28.    width: 300px;
  29.    height: 300px;
  30.    border-radius: 9px;      /* English : Replace with a property that makes the image borders look rounded. */
  31.            /* Français : Remplace par une propriété arrondissant les angles de l'image. */
  32. }
  33.  
  34.  
  35.  
  36. /* 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. */
  37. /* Français : Remplace les points ci-dessous par une classe "hover-effect" avec une pseudo-classe :hover. Cette classe doit cibler la première image et la troisième image de la page. */
  38.  
  39.    img:nth-of-type(1):hover {
  40.      opacity: 0.8;      /* English : Replace with a property responsible for opacity changes. */
  41.                     /* Français : Remplace par une propriété modifiant l'opacité. */
  42.     cursor: pointer;
  43. }
  44.    img:nth-of-type(3):hover{
  45.      opacity: 0.8;      /* English : Replace with a property responsible for opacity changes. */
  46.                     /* Français : Remplace par une propriété modifiant l'opacité. */
  47.     cursor: pointer;
  48. }
  49. /* English : Replace the dots below by a selector targeting the second image of the page. Do not use a class or an id! */
  50. /* Français : Remplace les points ci-dessous par un sélecteur ciblant la seconde image de la page. N'utilise pas de classe ou d'id ! */
  51.  
  52.  img:nth-of-type(2) {
  53.     filter: grayscale (3);
  54.     -webkit-filter: grayscale(3);
  55.    /* English : Replace with a property that makes the image look black & white. */
  56.                 /* Français : Remplace par une propriété faisant paraître l'image en noir et blanc. */
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement