Réduire l'espace entre deux images avec du code

  • Guillonneau
    Demandé le 20 février 2024 à 05:26

    Bonjour,


    J'aimerais réduire l'espacement entre mes images mais quand je rentre du code, même après enregistrement, il ne reste pas.


    Merci de votre aide

  • Waqas Jotform Support
    Répondu le 20 février 2024 à 05:55

    Hi Guillonneau,

    Thanks for reaching out to Jotform Support. Unfortunately, our French Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in French, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.

    Now, let me help you with your question. Yes, you can reduce the space by injecting CSS. Let me walk you through it:

    1. Copy the code below:

    /* Image */
    .form-all a img{
     display:inline-block;
     transform:translatex(0px) translatey(-60px);
    }


    /* Image */
    .form-all a img:nth-child(2){
     transform:translatex(0px) translatey(-197px);
    }


    /* Image */
    .form-all p:nth-child(5) img{
     transform:translatex(0px) translatey(-304px);
    }


    /* Image */
    .form-all p:nth-child(6) img{
     transform:translatex(0px) translatey(-367.1669999999999px);
    }

     2. In Form Builder, click on the Paint Roller icon on the right side of the page to open Form Designer.

    3. In the Form Designer menu, click on the Styles tab, scroll down and paste the code into the Inject CSS Code box.

    Réduire lespace entre deux images avec du code Image 1 Screenshot 20

    Give it a try and let us know how it goes.

  • Guillonneau
    Répondu le 20 février 2024 à 06:01

    Bonjour,


    Merci pour votre rapidité mais de mon côté je n'arrive toujours pas à réduire l'espacement entre les éléments, j'aimerais réduire l'espace entre les rectangles violet.

    En sachant que j'ai dû les créer via un bloc texte.

    Pouvez-vous m'aidez de nouveau svp ?

  • Waqas Jotform Support
    Répondu le 20 février 2024 à 06:22

    Hi Guillonneau,

    Thanks for getting back to us. I tested live form to see if I could replicate the issue, but everything was working properly. Check out the screenshot below to see my results:

    Réduire lespace entre deux images avec du code Image 1 Screenshot 20

    If that’s not exactly what you’re looking for, can you explain a bit more so I can help you better?

    After we hear back from you, we’ll have a better idea of what’s going on and how to help.


  • Guillonneau
    Répondu le 20 février 2024 à 06:26

    Le but serait d'avoir ce rendu, avec un tout petit peu d'espacement



    Réduire lespace entre deux images avec du code Image 1 Screenshot 20

  • Afzal Jotform Support
    Répondu le 20 février 2024 à 08:20

    Hi Guillonneau,

    Thanks for getting back to us. I cloned your form and tested it to see if I could replicate the issue, and I ran into the same problem. The reason for the extra space is the images you are using. The best way to resolve this issue is to remove the extra space by editing the images and re-uploading.

    Réduire lespace entre deux images avec du code Image 1 Screenshot 30

    This can also be fixed by adding custom CSS to your form. Check out the steps below to see how it's done:

    • Open your form in Form Builder and click on the blue Paint Roller icon on the right side of the screen.
    • Under the Styles tab, paste the code below into the Inject Custom CSS area.
    /*TO remove the extra space - 12060213*/
    img {
        margin-bottom: -90px !important;
    }

    img:nth-child(2) {
        margin-top: 20px;
    }

    Here's what the result will look like:

    Réduire lespace entre deux images avec du code Image 2 Screenshot 41

    Here's the cloned version of the form that you can test.

    Please give it a try and let us know how it goes.