jquery - CSS float: right -


i have part of html code:

 function mostralogin() {        $("#div-login").fadetoggle("fast");      }
    header {        height: 50px;        background-color: #ececec;        position: fixed;        right: 0px;        left: 0px;        box-shadow: 0px 5px 5px #b2b2b2;        -moz-box-shadow: 0px 5px 5px #b2b2b2;        -webkit-box-shadow: 0px 5px 5px #b2b2b2;        display: block;      }      #div-login {        width: 200px;        height: 180px;        background-color: rgba(0, 0, 0, 0.5);        border-radius: 8px;        border: 3px solid #4f9d97;        margin-left: 84%;        margin-top: 48px;        position: absolute;        display: none;        color: white;        text-align: center;        font-weight: bold;      }      #logintext {        color: #4f9d97;        font-size: 20px;        float: right;        margin-top: 10px;        margin-right: 10px;      }      #logintext:hover,      #logintext:active {        border-bottom: 1px solid #4f9d97;      }      #regtext {        color: #4f9d97;        font-size: 20px;        float: right;        margin-top: 10px;        margin-right: 5px;      }      #regtext:hover,      #regtext:active {        border-bottom: 1px solid #4f9d97;      }
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>      <header>        <a id="regtext"> registrazione </a>        <a id="logintext" onclick="mostralogin()"> login </a>        <form name="login" id="div-login" action="../php/login.php" method="post">          ... (form stuffs) ...        </form>      </header>

when click on word login should appear hidden form,everything working, until applied float: right on css file @ <a> tags. mostralogin() jquery function , :hover , :active things don't work anymore. why happen?

here final solution! html part:

<header>     <div id="textcont">     <a id="logintext" onclick="mostralogin()"/>login</a>     <a id="regtext" onclick="mostralogin()" />registrazione</a>     </div>     <form name="login" id="div-login" action="../php/login.php" method="post">  ... (form stuffs) ...     </form> </header> 

css part:

header {     height: 50px;     background-color: #ececec;     position: fixed;     right:0px;     left:0px;     box-shadow: 0px 5px 5px #b2b2b2;     -moz-box-shadow: 0px 5px 5px #b2b2b2;     -webkit-box-shadow: 0px 5px 5px #b2b2b2;     display: block;     text-align:right; }  #logintext {     color:#4f9d97;     font-size:20px;     margin-right: 20px; }  #logintext:hover, #logintext:active {     border-bottom: 1px solid #4f9d97; }  #regtext {     color:#4f9d97;     font-size:20px;     margin-right: 20px;  }  #regtext:hover, #regtext:active {     border-bottom: 1px solid #4f9d97; }  #textcont { margin-top: 10px;  } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -