Tried everything .. this just does not budge. This forum post is my last resort on this one. Its been 3 days messing around with a plethora of CSS setting combinations, checking JS for issues and just generally losing my hair.
Please help me with this .. I really dont want to have to give up this whole project because of one stupid line of code somewhere.
Problem: The popover box loads flush to the top of the screen, i've tried adding margins to every single container I can both in the bootstrap.css and removing/adding div elements to help resolve this .. and nothing !
HTML:
<a href="#" type="submit" name="login" data-placement="left" data-toggle="popover" data-target="#login-popover" class="glyphicon glyphicon-user" style="float: right; text-decoration: none;"></a>
<div id="login-popover" role="dialog" aria-labelledby="myPopoverLabel" aria-hidden="true" style="display: none;">
<div class="loginpopover-container">
<h1>Login to Your Account</h1>
<br>
<form method="post" >
<input type="text" name="username" placeholder="Username">
<input type="password" name="password" placeholder="Password">
<input type="submit" name="login" class="login loginpopover-submit" value="Login">
</form>
<div class="login-help"> <a href="#">Register</a><a href="#" style="float: right">Forgot Password</a> </div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2"> <?php echo $usernameErr; ?> <?php echo $passwordErr; ?> </div>
</div>
</div>
</div>
LOGINBOX.CSS:
@import url(http://fonts.googleapis.com/css?family=Roboto);
/****** LOGIN POPOVER ******/
.loginpopover-container {
padding: 10px;
max-width: 300px;
width: 100% !important;
overflow: hidden;
font-family: roboto;
}
.loginpopover-container h1 {
text-align: center;
font-size: 1.8em;
font-family: roboto;
}
.loginpopover-container input[type=submit] {
width: 100%;
display: block;
margin-bottom: 10px;
position: relative;
}
.loginpopover-container input[type=text], input[type=password] {
height: 44px;
font-size: 16px;
width: 100%;
margin-bottom: 10px;
-webkit-appearance: none;
background: #fff;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
/* border-radius: 2px; */
padding: 0 8px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.loginpopover-container input[type=text]:hover, input[type=password]:hover {
border: 1px solid #b9b9b9;
border-top: 1px solid #a0a0a0;
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.login-popover {
text-align: center;
font-size: 14px;
font-family: 'Arial', sans-serif;
font-weight: 700;
height: 36px;
/* border-radius: 3px; */
/* -webkit-user-select: none;
user-select: none; */
}
.loginpopover-submit {
/* border: 1px solid #3079ed; */
border: 0px;
color: #fff;
text-shadow: 0 1px rgba(0,0,0,0.1);
background-color: #4d90fe;
padding: 17px 0px;
font-family: roboto;
font-size: 14px;
/* background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#4d90fe), to(#4787ed)); */
}
.loginpopover-submit:hover {
/* border: 1px solid #2f5bb7; */
border: 0px;
text-shadow: 0 1px rgba(0,0,0,0.3);
background-color: #357ae8;
/* background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#4d90fe), to(#357ae8)); */
}
.loginpopover-container a {
text-decoration: none;
color: #666;
font-weight: 400;
text-align: center;
display: inline-block;
opacity: 0.6;
transition: opacity ease 0.5s;
}
.login-help{
font-size: 12px;
}
JAVASCRIPT:
<script>
$('[data-toggle=popover]').popover({
html: true,
content: function () {
var targetId = $(this).attr('data-target');
return $(targetId).html();
}
});
</script>
Just to say in my defense, the reason I am so annoyed is because I do everything possible on my end, so I dont have to push this to you guys. I exhaust every possible reason I can - this process however, seriously tests my patience.
Anyway, any help as always is appreciated. (sad whale face -_____-)