One of the page elements moves by clicking on the other!

Asked

Viewed 95 times

2

It is not Javascript that is doing this that I will quote below with my page, but yes, the CSS itself, I do not know what this is, I tried to solve 'without gambiarras', but it did not work :(

See for yourselves, click the login button, which is actually a link, and you will see that the other link next to the name "CREATE AN ACCOUNT" also moves. How to solve?

Page link.

A example playable on Jsfiddle.

  • 1

    The ideal would be for you to create an example Minimum, Complete and Verifiable, because when you fix your website, your question will make no sense to anyone else and only you will have benefited from your question. Ideally, it should serve as a lesson to other users with the same problem in the future.

  • I edited your question to add an example, it is not 100% but I think you can already have an idea. Who wants can improve it.

  • Oops, thanks for the help

1 answer

2


Do not leave the two elements in the same DIV, separate them.

Look how I tidied up:

<div class="content">
<img src="layout/img/logo_completa.png" alt="CCSHOP" title="CCSHOP - Passagens aéreas e muito mais...">
        <div class="login">
            <a href="#" class="btn-newacc">Criar uma conta</a>
        </div>
        <div class="login">          
            <a href="#" class="btn-login">Fazer Login</a>
        </div>
</div>

Note that I added another DIV with the login class, but when clicking on one or the other the effect does not occur for both elements at the same time.

  • Wow, I hadn’t thought of that kkkk, thanks, for not making a new topic, you know how I make the div with display: table-Cell (table line, I think) is the size of the elements inside it, and not with a more fixed space, never messed with tables, I started already in tableless, to better understand the site was like this: http://www.ccshop.com.br/prev

  • 1

    @heromax, I don’t know how to do what you asked now, but I’m glad to know that the answer was helpful on the topic.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.