As a beginner in CSS, I am encountering some issues with the HTML page of my application. I am currently working on an app and aiming to create a login view where the login form appears either after a voice command or button click. I am facing two main problems - first, I am unable to center my form (although it works fine on jsbin), and secondly, my target event (animation) is running after the page is ready rather than after a link click.
#przejscie
{
width: 340px;
display: block;
opacity: 0;
max-width: 100%;
margin: 0 auto;
position: relative;
top: 500px;
transition: transform 20s, background 50s;
-o-transition: -o-transform 16s, background 0.5s;
-moz-transition: -moz-transform 0.5s, background 0.5s;
-webkit-transition: -webkit-transform 3s, opacity 2s, background 0.5s;
}
#przejscie:target
{
transform: translate(-200);
-o-transform: scale(1.2);
-moz-transform: scale(1.2);
-webkit-transform: translate(0px,-300px );
opacity: 1;
}
This is my current CSS code for the form:
<html>
<head>
<script src="{% static 'js/artyom.min.js' %}"></script>
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{% static 'css/animacje.css' %}"/>
</head>
<h1><a href="#przejscie">Welcome register in our application</a></h1>
<div id="przejscie" class="container col-sm-3 srodek col-md-offset-2">
<form method="post" action="/PPProject-web/register" class="form-signin">
<label for="email" class="sr-only">Email Address</label>
<input name="email" class="form-control" id="email" type="email" placeholder="Email" required>
<label for="name" class="sr-only">Name</label>
<input name="name" class="form-control" id="name" placeholder="Name" required>
<label for="surname" class="sr-only">Surname</label>
<input name="surname" class="form-control" id="surname" placeholder="Surname" required>
<label for="username" class="sr-only">Username</label>
<input name="username" class="form-control" id="username" placeholder="Username" required>
<label for="password" class="sr-only">Password</label>
<input name="password" type="password" class="form-control" id="password" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
</form>
</div>
</html>
Although the target function is working properly, I still need assistance in centering this div element.