Viewing 8 replies - 1 through 8 (of 8 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Your images are displayed inline-block, which works when you have images next to each other:

    
    <img ... />
    <img ... />
    <img ... />
    

    But now the structure is changed and the images are not next to each other. So the style doesn’t work:

    
    <a ... >
        <img ... />
    </a>
    <a ... >
        <img ... />
    </a>
    <a ... >
        <img ... />
    </a>
    

    Maybe the easiest thing would be to install a ‘grid’ plugin.

    Thread Starter jamilos

    (@jamilos)

    Aah okay, thank you for your answer.

    What is another solution, if there is one ?

    (I can’t install any kind of plugins since the owner of the website doesn’t want that)

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try adding ‘picca’ class to all the links

    Thread Starter jamilos

    (@jamilos)

    I tried it, but nothing changes ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Could you double-check your browser’s cache has been cleared? It worked when I emulated it on the demo you’ve given above.

    Thread Starter jamilos

    (@jamilos)

    yea I tried, maybe I didnt put the piccas class in the right place.
    Aren’t the picca classes already in the code ? it says img class=”picca” next to the
    a href.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yes, but do you see why the inline block styles (applied to the picca class) don’t work on the images any more? Inline-block only works for content that is inline with one another. So you need to apply inline-block to the links (the anchor tags).

    
    <a class="picca" ... >
        <img ... />
    </a>
    <a class="picca"  ... >
        <img ... />
    </a>
    <a class="picca"  ... >
        <img ... />
    </a>
    
    Thread Starter jamilos

    (@jamilos)

    Aaaah yes it works now, thanks a lot Andrew !!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘a href changes layout’ is closed to new replies.