I have a button, and its background is white, with a 2px border. On :hover event, I created a transition to a colored background, but when the mouse is out, the background flashes to white immediately, instead of smoothly animates back to white.
What am I missing?
html input[type="button"],
.form-submit input[type="submit"] {
margin: 10px 5px 10px 5px;
-webkit-appearance: button;
cursor: pointer;
font-family: Aktiv-Grotesk, Verdana, Geneva, sans-serif;
font-weight: normal;
font-size: 13px;
padding: 9px 15px;
text-transform: uppercase;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
box-shadow: none;
cursor: pointer;
border: 2px solid #ff2e54;
;
-webkit-border-radius: 40px;
border-radius: 40px;
color: #ff2e54;
text-align: center;
-o-text-overflow: clip;
text-overflow: clip;
letter-spacing: 1px;
background: #fff;
-webkit-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
-moz-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
-o-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
transition: all 0.3s cubic-bezier(0, 0, 0, 0);
}
html input[type="button"]:hover,
.form-submit input[type="submit"]:hover {
background: rgba(255, 45, 84, 1);
background: -moz-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(255, 45, 84, 1)), color-stop(100%, rgba(255, 12, 72, 1)));
background: -webkit-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: -o-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: -ms-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: linear-gradient(to right, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff2d54', endColorstr='#ff0c48', GradientType=1);
border: 2px solid rgba(255, 255, 255, 0);
color: #fff;
-webkit-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-moz-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-o-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
}
html input[type="button"]:active,
.form-submit input[type="submit"]:active {
border: 2px solid #ff607f;
background: #ff607f!important;
color: #eee;
-webkit-box-shadow: 0px 1px 1px 0px #c12140;
-moz-box-shadow: 0px 1px 1px 0px #c12140;
-o-box-shadow: 0px 1px 1px 0px #c12140;
box-shadow: 0px 1px 1px 0px #c12140;
}
html input[type="button"]:disabled,
.form-submit input[type="submit"]:disabled {
-webkit-transition: all .2s ease-in-out 2s;
-moz-transition: all .2s ease-in-out 2s;
-o-transition: all .2s ease-in-out 2s;
transition: all .2s ease-in-out 2s;
cursor: default;
background-color: #fff;
border: 2px solid #E1E1E1;
color: #BBB;
box-shadow: none;
}
<input value="Download" type="button" onclick="this.disabled=true; this.value='Starting..';location.href='#'">
As far as a I know background gradients don't support transitions, so you have to get rid of the gradient (which is hard to see anyway) then it works:
html input[type="button"],
.form-submit input[type="submit"] {
margin: 10px 5px 10px 5px;
-webkit-appearance: button;
cursor: pointer;
font-family: Aktiv-Grotesk, Verdana, Geneva, sans-serif;
font-weight: normal;
font-size: 13px;
padding: 9px 15px;
text-transform: uppercase;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
box-shadow: none;
cursor: pointer;
border: 2px solid #ff2e54;
;
-webkit-border-radius: 40px;
border-radius: 40px;
color: #ff2e54;
text-align: center;
-o-text-overflow: clip;
text-overflow: clip;
letter-spacing: 1px;
background: rgba(255, 255, 255, 1);
-webkit-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
transition: all 0.3s cubic-bezier(0, 0, 0, 0);
}
html input[type="button"]:hover,
.form-submit input[type="submit"]:hover {
background: rgba(255, 45, 84, 1);
border: 2px solid rgba(255, 255, 255, 0);
color: #fff;
-webkit-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
}
html input[type="button"]:active,
.form-submit input[type="submit"]:active {
border: 2px solid #ff607f;
background: #ff607f!important;
color: #eee;
-webkit-box-shadow: 0px 1px 1px 0px #c12140;
-moz-box-shadow: 0px 1px 1px 0px #c12140;
-o-box-shadow: 0px 1px 1px 0px #c12140;
box-shadow: 0px 1px 1px 0px #c12140;
}
html input[type="button"]:disabled,
.form-submit input[type="submit"]:disabled {
-webkit-transition: all .2s ease-in-out 2s;
-moz-transition: all .2s ease-in-out 2s;
-o-transition: all .2s ease-in-out 2s;
transition: all .2s ease-in-out 2s;
cursor: default;
background-color: #fff;
border: 2px solid #E1E1E1;
color: #BBB;
box-shadow: none;
}
<input value="Download" type="button" onclick="this.disabled=true; this.value='Starting..';location.href='#'">
If you still want the gradient you should look into transition of gradient-position property - check this answer.
I stripped your CSS down a bit.. and then it works.
I don't think the browser likes all the gradient properties, the affect it pretty muted, is it necessary?
input[type="button"] {
margin: 10px 5px 10px 5px;
-webkit-appearance: button;
cursor: pointer;
font-family: Aktiv-Grotesk, Verdana, Geneva, sans-serif;
font-weight: normal;
font-size: 13px;
padding: 9px 15px;
text-transform: uppercase;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
box-shadow: none;
cursor: pointer;
border: 2px solid #ff2e54;
;
-webkit-border-radius: 40px;
border-radius: 40px;
color: #ff2e54;
text-align: center;
-o-text-overflow: clip;
text-overflow: clip;
letter-spacing: 1px;
background: #fff;
transition: 0.3s;
}
input[type="button"]:hover {
background: rgba(255, 45, 84, 1);
border: 2px solid rgba(255, 255, 255, 0);
color: #fff;
-webkit-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-moz-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-o-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
}
html input[type="button"]:active {
border: 2px solid #ff607f;
background: #ff607f!important;
color: #eee;
-webkit-box-shadow: 0px 1px 1px 0px #c12140;
-moz-box-shadow: 0px 1px 1px 0px #c12140;
-o-box-shadow: 0px 1px 1px 0px #c12140;
box-shadow: 0px 1px 1px 0px #c12140;
}
html input[type="button"]:disabled,
.form-submit input[type="submit"]:disabled {
-webkit-transition: all .2s ease-in-out 2s;
-moz-transition: all .2s ease-in-out 2s;
-o-transition: all .2s ease-in-out 2s;
transition: all .2s ease-in-out 2s;
cursor: default;
background-color: #fff;
border: 2px solid #E1E1E1;
color: #BBB;
box-shadow: none;
}
You can see it working in this fiddle: https://jsfiddle.net/nvqukp3L/1/
Related
I have two divs on this page, the second div has an iframe in it. It looks, works, feels fine, however, after applying bootstrap css and js, the whole page gets a wrapped look, and everything is stuffed into the middle (see pics attached.) Maybe my other css file has something to do with it?
My css:
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html,body,.container {
height:100%;
}
body {
margin: 0;
background: #f7f7f7;
color: #363636;
font-family: 'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;
font-size: 16px;
line-height: 1.42857143;
}
.logo {
display: block;
margin: 30px auto;
}
.form {
max-width: 400px;
padding: 20px;
margin: 30px auto;
}
.form-group {
margin-bottom: 30px;
}
.form-group label {
display: block;
}
.form-control {
margin: 0;
display: block;
width: 100%;
height: 36px;
padding: 6px 12px;
font-size: 16px;
line-height: 1.42857143;
color: #363636;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.btn {
display: block;
width: 100%;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
white-space: nowrap;
padding: 9px 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #ffffff;
box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
background-image: none;
border: 0;
height: 50px;
font-size: 20px;
line-height: 1.3333333;
border-radius: 0;
font-weight: 700;
-webkit-transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
-o-transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn:focus {outline: 0;}
.btn:hover {background-color: #398023;}
.btn:active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-webkit-transform: scale(0.95);
-ms-transform: scale(0.95);
-o-transform: scale(0.95);
transform: scale(0.95);
}
/* Zebra
.btn {background-color: #00a66e;}*/
/* EASI'R */
/*.btn {background-color: #81c074;}*/
/* Skoda */
.btn {background-color: #4ba82e;}
.contentbar {
/*border: 1px solid red;*/
width: 100%;
height: 110px;
}
.mainContent {
border: 1px solid gray;
width:100%;
height:100%;
}
.mainContent iframe {
/*border: 1px solid green;*/
width:100%;
height: 100%;
/*height:calc(100% - 150px);*/
}
I use the following to apply bootstrap:
<link rel="stylesheet" type="text/css" href="/css/bootstrap/bootstrap.css">
<script src="/js/bootstrap/bootstrap.js"></script>
See here my attached before and after pics.
Thanks
you might using a div with class "container" in html that's why everything is coming center.
i got a "news" thing on my navigation bar, it uses marquee to have moving text but when the text gets too long, it pushes my content (not the content of the navigation bar but the main content on the website). it is also unable to start from the beginning of the navigation bar and rather chose to start from the middle but really depends on how long the text is...
navigationbar.php
<?php
function echoSelectedClassIfRequestMatches($requestUri)
{
$current_file_name = basename($_SERVER['REQUEST_URI']);
if ($current_file_name == $requestUri)
echo 'class="selected"';
}
?>
<!--START NAVIGATION-->
<div class="nav-align">
<div class="social-wrapper">
Social Media :
<i class="fa fa-facebook-official"></i><!--facebook-->
<i class="fa fa-twitter-square"></i><!--twitter-->
<i class="fa fa-youtube-play"></i><!--youtube-->
<i class="fa fa-google-plus-square"></i><!--google+-->
<i class="fa fa-instagram"></i><!--instagram-->
<i class="fa fa-steam-square"></i><!--steam-->
</div>
<nav class="nav-main">
<a href="/">
<img class="logo" src=""></img>
</a>
<?php
if(empty($_SESSION['user'])){
echo'<div class="user-container">';
echo'You are signed in as guest, please';
echo'Sign In';
echo'or';
echo'Sign Up';
echo'</div>';
}else {
echo'<div class="user-container">';
echo"<span><i class='fa fa-wrench'></i></span> <a class='a' href='/settings'> Settings";
echo"</a>";
echo" | ";
echo'<a class="a" href="/user/';
echo htmlentities($_SESSION['user']['id'], ENT_QUOTES, 'UTF-8');
echo '">';
echo htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8');
echo'</a> <span><i class="fa fa-user"></i></span>
Sign Out <i class="fa fa-sign-out"></i>';
echo'</div>';
}
?>
</nav>
<div class="nav-item-container">
<ul>
<li>
<div <?=echoSelectedClassIfRequestMatches("")?>>Home </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("about")?>>About </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("contact")?>>Contact </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("forum")?>>Forum </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("upload")?>>Upload </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("server")?>>Server </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("clan")?>>Clan </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("misc")?>>Misc </div>
</li>
<div class="news-wrapper">
<div class="news-content">
<i class="fa fa-bullhorn"></i> NEWS :
</div>
</div>
</ul>
<ul>
<li style="overflow:hidden;">
<div class="marquee-wrapper">
<marquee behavior="scroll" direction="left" scrollamount="4" onmouseover="this.stop();" onmouseout="this.start();">
<?php
$items = Array(
"<span><i class='fa fa-bullhorn'></i> NEWS:</span> Welcome to the website!",
"Welcome <span> <a class='a2' href='/user/'>".htmlentities($row['username'], ENT_QUOTES, 'UTF-8')."</a></span> to the website!",
"We currently got <span> ".htmlentities($row['id'], ENT_QUOTES, 'UTF-8')." </span> Unique members :)",
//"You can easly visit other members profiles by typing '/user/[id]' just replace [id] by any number.",
);
echo $items[array_rand($items)];
?>
</marquee>
</div>
</li>
</ul>
</div>
</div>
nav-bar.css
#charset "utf-8";
.nav-align {
width:85.1%;
padding-top:40px;
margin:auto;
}
.nav-main{
margin:auto;
background-image: url("/images/background/navigationbar.jpg") !important;
border: 1px solid #000;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
height:80px;
color:#858d9a;
z-index:50;
}
.nav-main .logo{
float:left;
color:#fff;
text-decoration: none;
width:20%;
padding:5px 20px;
font-size:1.4em;
line-height:30px;
}
.user-container {
float:right !important;
height:30px;
padding: 20px 20px;
font-size:15px;
}
.nav-item-container {
border-left:1px solid black;
border-right:1px solid black;
background-color: #1d1d1d;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
height:30px;
}
.nav-item-container > ul{
float:left;
list-style-type:none;
overflow:hidden;
}
.nav-item-container > ul > li{
float:left;
}
.nav-item{
font-size:12px;
display:inline-block;
padding:5px 10px;
height:20px;
line-height:20px;
color:#7D91A3;
text-decoration:none;
}
.selected {
color:#05c7f7 !important;
}
.nav-item:hover {
color:#fff;
text-shadow: 0 1px 2px #000;
-webkit-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
-moz-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
background-image: linear-gradient(to top, #096aa1, #26c3f6);
}
.nav-content{
position:absolute;
top:184px;
overflow:hidden;
background-color:#0d0f11;
max-height:0;
}
.nav-content a{
color:#fff;
text-decoration:none;
}
.nav-sub{
padding:10px;
}
.nav-sub ul{
padding:0;
margin:0;
list-style-type:none;
}
.nav-sub ul li a{
display:inline-block;
padding:3px 0;
padding-left:10px;
color:#7D91A3;
}
.nav-sub ul li a:hover{
color:#05c7f7;
}
.nav-item:focus ~ .nav-content{
max-height:100px;
border-left: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
background-color: #1d1d1d;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
z-index:4000;
}
.social-wrapper {
border-top:1px solid black;
border-left:1px solid black;
border-right:1px solid black;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
width:20%;
min-width:230px;
padding-left:10px;
padding-right:10px;
line-height:30px;
height:30px;
margin:auto;
}
.social-wrapper:hover {
color:#05c7f7;
}
.nav-social-icons {
padding-top:6px !important;
line-height:21.5px;
font-size:17px;
padding:3px;
color:#777f8c;
float:right;
}
.nav-social-icons:hover {
color:#fff;
-webkit-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
-moz-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
background-image: linear-gradient(to top, #096aa1, #26c3f6);
}
.news-content {
background-color:#05c7f7;
color:#05c7f7;
padding:3px;
width:100%;
float:right;
font-weight:bold;
line-height:25px;
background-color: #1d1d1d;
-webkit-box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
border: 1px solid #000;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-ms-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
}
.news-content:before {
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
}
.marquee-wrapper {
line-height:30px !important;
float:right;
}
.news-wrapper {
padding-left:120px !important;
float:right;
line-height:25px;
}
a wrapper above all content
.content-wrapper { background-image: url("/images/background/content.jpg") !important; width:85%; border: 1px solid #000; background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528); background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528); background-image: -o-linear-gradient(bottom, #1a1b1f, #212528); background-image: linear-gradient(to top, #1a1b1f, #212528); margin:auto;}
Do not use the <marquee> element, it is deprecated.
“This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.”
https://developer.mozilla.org/en/docs/Web/HTML/Element/marquee
But to fix your problem you could try adding overflow: hidden to either .marquee-wrapper or .marquee-wrapper marquee
I have a page here:
http://www.simplypsychics.com/psychicprofile.php?pin=4439
and at the bottom I am using buttons. But my site has a standard button style which I use in the following way:
View all our great psychics
The CSS applied to it is this:
.placementtext_button {
background-color: #9a3ba8;
background-image:url(headerbuttons2.jpg);
border-radius:5px;
margin: 10px 10px 10px 10px;
color:#5c5c5a;
font-family:"Century Gothic", sans-serif !important;
font-size:14px !important;
padding:8px !important;
vertical-align: top;
line-height:33px;
text-align:center;
text-decoration:none;
-webkit-text-size-adjust:none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
.placementtext_button:hover {
background-color: #494949;
background-image:url(headerbuttons2.jpg);
border-radius:5px;
margin: 10px 10px 10px 10px;
color:#f8c7ff;
font-family:"Century Gothic", sans-serif !important;
font-size:14px !important;
padding:8px !important;
vertical-align: top;
line-height:33px;
text-align:center;
text-decoration:none;
-webkit-text-size-adjust:none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
but my PHP buttons look completely different. See this image to explain:
http://i61.tinypic.com/102jck1.jpg
and I tried to modify the CSS to appear the same but it isn't working.
Does anyone know where I am going wrong?
This is the CSS for the button:
form input[type="submit"] {
background-color: #9a3ba8;
border-radius: 5px;
margin: 10px 10px 10px 10px;
color: #5c5c5a;
font-family: "Century Gothic", CenturyGothic, AppleGothic, 'Muli', sans-serif !important;
font-size: 14px !important;
padding: 8px !important;
vertical-align: top;
line-height: 33px;
text-align: center;
text-decoration: none !important;
-webkit-text-size-adjust: none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
Try this:
form input[type="submit"] {
background-color: #9a3ba8;
border-radius: 5px;
margin: 10px 10px 10px 10px;
font-family: "Century Gothic", CenturyGothic, AppleGothic, 'Muli', sans-serif !important;
font-size: 14px !important;
padding: 0px !important;
vertical-align: top;
line-height: 33px;
text-align: center;
text-decoration: none !important;
-webkit-text-size-adjust: none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
letter-spacing: -1px;
font-weight: bold;
color: #ffffff;
border: none;
}
ssergei's on the right track. The key, in this case, is border: none;.
This could also all be consolidated a lot more; there's no need to repeat styles that aren't changing during a hover state. And, if possible, it's best to style similarly styled selectors together (separated by commas) to keep your code cleaner and smaller.
.placementtext_button,
form input[type="submit"] {
background-color: #9a3ba8;
border-radius: 5px;
border: none;
margin: 10px 10px 10px 10px;
color: #ffffff;
font-family: "Century Gothic", CenturyGothic, AppleGothic, 'Muli', sans-serif !important;
font-size: 14px !important;
padding: 8px !important;
vertical-align: top;
line-height: 33px;
text-align: center;
text-decoration: none !important;
-webkit-text-size-adjust: none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
.placementtext_button:hover,
form input[type="submit"]:hover {
background-color: #494949;
color:#f8c7ff;
}
My divs keep shifting when I resize the page can someone help me with this?
html/php (php for login and page getter)
my html body part with some php for login in and something with the page
<div class="menu">
<img src="logo.png" style=" position: relative; margin-right: 38%">
<ul class="dropdown">
<li><a href="?page=Home" <?php if ($page == 'Home') { ?> id="a-active" <?php } ?> >Home</a>
<ul class="sub_menu">
<li>News</li>
<li>Servers</li>
</ul>
</li>
<li><a href="?page=Forum" <?php if ($page == 'Forum') { ?> id="a-active" <?php } ?> >Forum</a>
<ul class="sub_menu">
<li>Common</li>
<li>Information</li>
<li>Griefs & Player reports</li>
<li>
Unbans
</li>
</ul>
</li>
<li><a href="?page=Information" <?php if ($page == 'Information') { ?> id="a-active" <?php } ?> >Information</a>
<ul class="sub_menu">
<li>
Rules
</li>
<li>
Staff
</li>
<li>
Servers
<ul>
<li>Survival</li>
<li>Games</li>
</ul>
</li>
</ul>
</li>
<li><a href="?page=Topscores" <?php if ($page == 'Topscores') { ?> id="a-active" <?php } ?> > Topscores</a>
<ul class="sub_menu">
<li>Playtime</li>
<li>Kills</li>
<li>Game wins</li>
</ul>
</li>
<li><a href="?page=Donations" <?php if ($page == 'Donations') { ?> id="a-active" <?php } ?> >Donation</a>
</li>
</ul>
<div class="content">
<?php
if ($page == 'Forum') {
include 'forum/index.html';
} elseif ($page == 'Information') {
include 'information/index.html';
} elseif ($page == 'Topscores') {
include 'topscores/index.html';
} elseif ($page == 'Donations') {
include 'donations/index.html';
} elseif ($page == 'Home') {
include 'home/index.html';
} else {
include '404/index.html';
}
?>
</div>
<div class="contentmirror1">
<?php
if (isset($_SESSION['username'])) {
?>
<form width="110px" id="form1" name="form1" method="post" action="logout.php">
<table width="100px" border="0" align="center">
<tr>
<td colspan="2">Welcome</td>
</tr>
<tr>
<td><input readonly type="text" name="name" style="border:none; background-color: transparent;" value="<?php echo htmlspecialchars($_SESSION['username']); ?>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="button" value="Logout" /></td>
</tr>
</table>
</form>
<?php
} else {
?>
<form width="110px" id="form1" name="form1" method="post" action="login.php">
<table width="100px" border="0" align="center">
<tr>
<td colspan="2">Login</td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="username" id="username" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" id="password" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="button" value="Login" /></td>
</tr>
</table>
</form>
<?php
}
?>
</div>
<div class="contentmirror" style="Clear: Both;">
spambox/online shizzle
</div>
</div>
my css
.head{
height: 115px;
width: 100%;
position: absolute;
top: 0px;
left: 0px;
background: rgb(200,200,200);
z-index: -999;
}
html {
background: url('background.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.menu{
display: inline-block;
position: absolute;
padding: 2%;
text-align: center;
width: 86%;
left: 0px;
top: 0px;
font-family: arial;
z-index: 0;
}
.menu::after {
padding-top: 56.25%; /* percentage of containing block _width_ */
display: block;
content: '';
}
.content{
float: left;
margin-top: 5%;
width: 60%;
max-width: 60%;
padding: 1%;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.contentmirror{
float: right;
margin-top: -3%;
margin-right: 5%;
max-width: 26%;
width: 26%;
padding: 1%;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.contentmirror1{
float: right;
margin-top: -25%;
margin-right: 8%;
max-width: 26%;
width: 26%;
padding: 1%;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.sidepanelright{
float: right;
}
.main{
text-align: center;
font-family: arial;
font-size: 24px;
}
.pics {
width: 70%;
max-height: 100%;
margin: 0px auto;
}
.pic {
display: none;
background-color: transparent;
border: none;
width: 100%;
max-height: 100%;
}
.menu a{
color: black;
background-color: white;
padding: 5px 10px;
margin: 0px 5px;
border-radius: 10px;
text-decoration: none;
-moz-box-shadow: 0px 0px 20px 0px #4E4E4E;
-webkit-box-shadow: 0px 0px 20px 0px #4E4E4E;
box-shadow: 0px 0px 20px 0px #4E4E4E;
z-index: 0;
}
.menu a:hover{
padding: 7px 12px;
-moz-box-shadow: 0px 0px 30px 0px white;
-webkit-box-shadow: 0px 0px 30px 0px white;
box-shadow: 0px 0px 30px 0px white;
}
#logo{
float: left;
top: -90px;
position: relative;
margin: 5px 0px 0px 5px;
width: 15%;
max-height: 100%;
z-index: 1;
}
.btn:hover, .btn:focus {
color: #333333;
text-decoration: none;
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
.btn:hover, .btn:focus, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {
color: #333333;
background-color: #e6e6e6;
}
.btn {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
line-height: 20px;
color: #333333;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
border: 1px solid #cccccc;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
#btn {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
line-height: 20px;
color: #333333;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
border: 1px solid #cccccc;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
#btn:hover, #btn:focus, #btn:active, #btn.active, #btn.disabled, #btn[disabled] {
color: #333333;
background-color: #e6e6e6;
}
#btn:hover, #btn:focus {
color: #333333;
text-decoration: none;
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
#a-active{
color: black;
background-color: #DDDDDD;
padding: 5px 10px;
margin: 0px 5px;
border-radius: 10px;
text-decoration: none;
-moz-box-shadow: 0px 0px 20px 0px #4E4E4E;
-webkit-box-shadow: 0px 0px 20px 0px #4E4E4E;
box-shadow: 0px 0px 20px 0px #4E4E4E;
z-index: 0;
}
#a-active:hover{
background-color: white;
padding: 7px 12px;
-moz-box-shadow: 0px 0px 30px 0px white;
-webkit-box-shadow: 0px 0px 30px 0px white;
box-shadow: 0px 0px 30px 0px white;
}
* { margin: 0; padding: 0; }
body { font: 14px Helvetica, Sans-Serif; }
#page-wrap { width: 800px; margin: 25px auto; }
a { text-decoration: none; }
ul { list-style: none;}
p { margin: 15px 0; }
/*
LEVEL ONE
*/
.drops{
margin-left: 30%;
}
ul.dropdown { position: relative; margin-left: 37%; margin-top: 2%;}
ul.dropdown li { font-weight: bold; float: left; zoom: 1; }
ul.dropdown a:hover { }
ul.dropdown a:active { }
ul.dropdown li a { display: block; padding: 4px 8px; border-right: 1px solid #333;
}
ul.dropdown li:last-child a { border-right: none; } /* Doesn't work in IE */
ul.dropdown li.hover,
ul.dropdown li:hover { color: black; position: relative; }
ul.dropdown li.hover a { color: black; }
/*
LEVEL TWO
*/
ul.dropdown ul { width: 220px; visibility: hidden; position: absolute; top: 100%; left: 0; }
ul.dropdown ul li { font-weight: normal; float: none; }
/* IE 6 & 7 Needs Inline Block */
ul.dropdown ul li a { border-right: none; width: 100%; display: inline-block; }
/*
LEVEL THREE
*/
ul.dropdown ul ul { left: 100%; top: 0; }
ul.dropdown li:hover > ul { visibility: visible; }
when I resize the window the divs shifts to the left or down. is there a way to set those divs on one position where they do not shift positions just stay there?
I pretty much didn't understand your code, but made this fiddle to make you understand how to fix the divs.
I would suggest you to avoid float for divs and do something like:
.fix{
/* this is parent div */
display:inline-block ;
white-space:nowrap;
}
.fxchld{
/* these are child divs */
width:50px;
display:inline-block ;
height:50px;
border:1px solid #000;
}
idea is to use display:inline-block ; instead of floats so that they remain fixed to their position
else
you'll have to give large parent div width so that child divs won't wrap
Fiddle will help you understand my point!!
i have a site with shtml extensions for ssi. i have 2 popups using css, no J. I have a form in the popup, the contents are a php include. The php executes before initally loading the form. but I can't figure out how to process the php without leaving the popup, or even the original page.
I am new to php - have VBscript experience. But I am really a fishing guide, not a programmer. becoming very obvious today.
Thank you for your help
<div class="popup">
<h2>Request a brochure</h2>
<!--#include file="includes/bropopup.php" -->
</div>
here is the include...
<?php
echo 'first php done<br>';
if (!isset($_POST['submit'])) {
echo 'php executed';
?>
<form name="frm_brochure_request" action="phptest.shtml" method="post">
<div>
<label for="firstname">First Name</label>
<input type="text" id="firstname" name="firstname" value="first name" />
</div>
<input type="submit" name="submit" value="request brochure">
</form>
<?php
}
else {
echo 'submitted <br />';
}?>
Here is most of the css - I am using this from an online demo. the demo didn't include any form functionality, however.
.overlay {
background-color: rgba(0, 0, 0, 0.6);
bottom: 0;
cursor: default;
left: 0;
opacity: 0;
position: fixed;
right: 0;
top: 0;
visibility: hidden;
z-index: 1;
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
.overlay:target {
visibility: visible;
opacity: 1;
}
.popup {
background-color: #fff;
border: 3px solid #fff;
display: inline-block;
left: 50%;
opacity: 0;
padding: 15px;
position: fixed;
text-align: justify;
top: 40%;
visibility: hidden;
z-index: 10;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-webkit-transition: opacity .5s, top .5s;
-moz-transition: opacity .5s, top .5s;
-ms-transition: opacity .5s, top .5s;
-o-transition: opacity .5s, top .5s;
transition: opacity .5s, top .5s;
}
.overlay:target+.popup {
top: 50%;
opacity: 1;
visibility: visible;
}
.close {
background-color: rgba(0, 0, 0, 0.8);
height: 30px;
line-height: 30px;
position: absolute;
right: 0;
text-align: center;
text-decoration: none;
top: -15px;
width: 30px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
border-radius: 15px;
}
.close:before {
color: rgba(255, 255, 255, 0.9);
content: "X";
font-size: 24px;
text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
}
.close:hover {
background-color: rgba(64, 128, 128, 0.8);
}
.popup p, .popup div {
margin-bottom: 10px;
}
.popup label {
display: inline-block;
text-align: left;
width: 120px;
}
.popup input[type="text"], .popup input[type="password"] {
border: 1px solid;
border-color: #999 #ccc #ccc;
margin: 0;
padding: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-ms-border-radius: 2px;
-o-border-radius: 2px;
border-radius: 2px;
}
.popup input[type="text"]:hover, .popup input[type="password"]:hover {
border-color: #555 #888 #888;
}