Div overlap another div - css
I have an issue I really can't figure out.
My login div overlapping my menu when my screen solution is smaller than XX. (found out when i changed from 21" to 15".)
I godt an menu witch seems to stay where it's placed, but the login box under is overlapping.
I got my css here:
/*******************
FONTS
*******************/
#import url(http://fonts.googleapis.com/css?family=Bree+Serif);
/*******************
SELECTION STYLING
*******************/
::selection {
color: #fff;
background: #f676b2; /* Safari */
}
::-moz-selection {
color: #fff;
background: #f676b2; /* Firefox */
}
/*******************
BODY STYLING
*******************/
* {
margin: 0;
padding: 0;
border: 0;
}
/*******************
TOPBAR
*******************/
#topbar {
list-style: none;
font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
letter-spacing: -0.5px;
font-size: 13px;
text-shadow: 0 -1px 3px #202020;
width: 100%;
height: 30px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #787878), color-stop(0.5, #5E5E5E), color-stop(0.51, #707070), color-stop(1, #838383));
background-image: -moz-linear-gradient(center bottom, #787878 0%, #5E5E5E 50%, #707070 51%, #838383 100%);
background-color:#5f5f5f;
/*-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;*/
-moz-box-shadow: 0px 3px 3px #cecece;
-webkit-box-shadow: 0px 3px 3px #cecece;
box-shadow: 0 3px 4px #8b8b8b;
}
#wrapper1 {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight:300;
text-align: left;
text-decoration: none;
/* Center wrapper perfectly */
width: 300px;
height: 400px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -150px;
margin-top: -200px;
}
/*
.gradient {
width: 600px;
height: 600px;
position: fixed;
left: 50%;
top: 50%;
margin-left: -300px;
margin-top: -300px;
background: url(../img/gradient.png) no-repeat;
}
*/
.gradient {
/* Center Positioning */
width: 600px;
height: 600px;
position: fixed;
left: 50%;
top: 50%;
margin-left: -300px;
margin-top: -300px;
/* Fallback */
background-image: url(../img/gradient.png);
background-repeat: no-repeat;
/* CSS3 Gradient */
background-image: -webkit-gradient(radial, 0% 0%, 0% 100%, from(rgba(213,246,255,1)), to(rgba(213,246,255,0)));
background-image: -webkit-radial-gradient(50% 50%, 40% 40%, rgba(213,246,255,1), rgba(213,246,255,0));
background-image: -moz-radial-gradient(50% 50%, 50% 50%, rgba(213,246,255,1), rgba(213,246,255,0));
background-image: -ms-radial-gradient(50% 50%, 50% 50%, rgba(213,246,255,1), rgba(213,246,255,0));
background-image: -o-radial-gradient(50% 50%, 50% 50%, rgba(213,246,255,1), rgba(213,246,255,0));
}
/*******************
MENU
*******************/
#menu {
margin: 40px 0;
list-style: none;
font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
letter-spacing: -0.5px;
font-size: 13px;
text-shadow: 0 -1px 3px #202020;
width: 980px;
height: 34px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: 0px 3px 3px #cecece;
-webkit-box-shadow: 0px 3px 3px #cecece;
box-shadow: 0 3px 4px #8b8b8b;
}
#menu li {
display: block;
float: left;
border-right: 1px solid #5d5d5d;
border-left: 1px solid #929292;
width: 105px;
height: 34px;
border-bottom: 1px solid #575757;
border-top: 1px solid #797979;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #787878), color-stop(0.5, #5E5E5E), color-stop(0.51, #707070), color-stop(1, #838383));
background-image: -moz-linear-gradient(center bottom, #787878 0%, #5E5E5E 50%, #707070 51%, #838383 100%);
background-color:#5f5f5f;
}
#menu li:not(:last-child):hover {
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #3F3F3F), color-stop(0.5, #383838), color-stop(0.51, #434343), color-stop(1, #555555));
background-image: -moz-linear-gradient(center bottom, #3F3F3F 0%, #383838 50%, #434343 51%, #555555 100% );
background-color:#383838;
-moz-box-shadow: inset 0 0 5px 5px #535353;
-webkit-box-shadow: inset 0 0 5px 5px #535353;
box-shadow: inset 0 0 5px 5px #535353;
}
#menu li:not(:last-child):active {
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #3F3F3F), color-stop(0.5, #383838), color-stop(0.51, #434343), color-stop(1, #555555));
background-image: -moz-linear-gradient(center bottom, #3F3F3F 0%, #383838 50%, #434343 51%, #555555 100% );
background-color:#383838;
-moz-box-shadow: inset 0 1px 2px 2px #000;
-webkit-box-shadow: inset 0 1px 2px 2px #000;
box-shadow: inset 0 1px 2px 2px #000;
}
#menu li a {
color: white;
text-decoration: none;
text-align: center;
display: block;
line-height: 34px;
outline: none;
}
#menu form input {
width: 76px;
height: 20px;
margin-left: 9px;
margin-top: 8px;
border: none;
padding-left: 20px;
padding-right: 10px;
color: #eee;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
background-image: url("../img/magnifier.png"), -webkit-gradient(linear, left bottom, left top, color-stop(0, #747474), color-stop(0.5, #6E6E6E), color-stop(0.51, #7E7E7E), color-stop(1, #8D8D8D));
background-image: url("../img/magnifier.png"), -moz-linear-gradient(center bottom, #747474 0%, #6E6E6E 50%, #7E7E7E 51%, #8D8D8D 100%);
background-repeat: no-repeat;
background-color: #6E6E6E;
-moz-box-shadow: inset 0 2px 1px 1px #363636;
-webkit-box-shadow: inset 0 2px 1px 1px #363636;
box-shadow: inset 0 2px 1px 1px #363636;
}
#menu li:first-child {
-moz-border-radius: 4px 0 0 4px;
-webkit-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
border-left: none;
}
#menu li:first-child a img {
vertical-align: middle;
margin-top: -2px;
}
#menu li:last-child {
-moz-border-radius: 0 4px 4px 0;
-webkit-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
border-right: none;
width: 124px;
}
#-webkit-keyframes showMenu {
from { opacity: 0; top: -20px; }
to { opacity: 1; }
}
#menu {
-webkit-animation: showMenu 1s;
position: relative;
}
/*******************
LOGIN FORM
*******************/
.login-form {
width: 300px;
margin: 0px auto;
position: absolute;
z-index:5;
background: #f3f3f3;
border: 1px solid #fff;
border-radius: 5px;
box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
/*******************
HEADER
*******************/
.login-form .header {
padding: 40px 30px 30px 30px;
}
.login-form .header h1 {
font-family: 'Bree Serif', serif;
font-weight: 300;
font-size: 28px;
line-height:34px;
color: #414848;
text-shadow: 1px 1px 0 rgba(256,256,256,1.0);
margin-bottom: 10px;
}
.login-form .header span {
font-size: 11px;
line-height: 16px;
color: #678889;
text-shadow: 1px 1px 0 rgba(256,256,256,1.0);
}
/*******************
CONTENT
*******************/
.login-form .content1 {
padding: 0 30px 25px 30px;
}
/* Input field */
.login-form .content1 .input {
width: 188px;
padding: 15px 25px;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 400;
font-size: 14px;
color: #9d9e9e;
text-shadow: 1px 1px 0 rgba(256,256,256,1.0);
background: #fff;
border: 1px solid #fff;
border-radius: 5px;
box-shadow: inset 0 1px 3px rgba(0,0,0,0.50);
-moz-box-shadow: inset 0 1px 3px rgba(0,0,0,0.50);
-webkit-box-shadow: inset 0 1px 3px rgba(0,0,0,0.50);
}
/* Second input field */
.login-form .content1 .password, .login-form .content .pass-icon {
margin-top: 25px;
}
.login-form .content1 .input:hover {
background: #dfe9ec;
color: #414848;
}
.login-form .content1 .input:focus {
background: #dfe9ec;
color: #414848;
box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
}
.user-icon, .pass-icon {
width: 46px;
height: 47px;
display: block;
position: absolute;
left: 0px;
padding-right: 2px;
z-index: 3;
-moz-border-radius-topleft: 5px;
-moz-border-radius-bottomleft: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
.user-icon {
top:147px; /* Positioning fix for slide-in, got lazy to think up of simpler method. */
background: rgba(65,72,72,0.75) url(../img/user-icon.png) no-repeat center;
}
.pass-icon {
top:221px;
background: rgba(65,72,72,0.75) url(../img/pass-icon.png) no-repeat center;
}
/* Animation */
.input, .user-icon, .pass-icon, .button, .register {
transition: all 0.5s;
-moz-transition: all 0.5s;
-webkit-transition: all 0.5s;
-o-transition: all 0.5s;
-ms-transition: all 0.5s;
}
/*******************
FOOTER
*******************/
.login-form .footer {
padding: 25px 30px 40px 30px;
overflow: auto;
background: #d4dedf;
border-top: 1px solid #fff;
box-shadow: inset 0 1px 0 rgba(0,0,0,0.15);
-moz-box-shadow: inset 0 1px 0 rgba(0,0,0,0.15);
-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.15);
}
/* Login button */
.login-form .footer .button {
float:left;
padding: 11px 25px;
font-family: 'Bree Serif', serif;
font-weight: 300;
font-size: 18px;
color: #fff;
text-shadow: 0px 1px 0 rgba(0,0,0,0.25);
background: #56c2e1;
border: 1px solid #46b3d3;
border-radius: 5px;
cursor: pointer;
box-shadow: inset 0 0 2px rgba(256,256,256,0.75);
-moz-box-shadow: inset 0 0 2px rgba(256,256,256,0.75);
-webkit-box-shadow: inset 0 0 2px rgba(256,256,256,0.75);
}
.login-form .footer .button:hover {
background: #3f9db8;
border: 1px solid rgba(256,256,256,0.75);
box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
-moz-box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.login-form .footer .button:focus {
position: relative;
bottom: -1px;
background: #56c2e1;
box-shadow: inset 0 1px 6px rgba(256,256,256,0.75);
-moz-box-shadow: inset 0 1px 6px rgba(256,256,256,0.75);
-webkit-box-shadow: inset 0 1px 6px rgba(256,256,256,0.75);
}
/* Register button
.login-form .footer .register {
display: block;
float: right;
padding: 10px;
margin-right: 20px;
background: none;
border: none;
cursor: pointer;
font-family: 'Bree Serif', serif;
font-weight: 300;
font-size: 18px;
color: #414848;
text-shadow: 0px 1px 0 rgba(256,256,256,0.5);
}
.login-form .footer .register:hover {
color: #3f9db8;
}
.login-form .footer .register:focus {
position: relative;
bottom: -1px;
}*/
I'm not a genius in CSS, so im glad to see people helps in here, and so damn fast generally!
Thank you! :-)
edit #wrapper1 like this:
#wrapper1 {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
text-align: left;
text-decoration: none;
width: 300px;
height: 400px;
position: absolute;
left: 50%;
top: 145px; /* or more */
margin-left: -150px;
}
and your gradient like this:
.gradient {
width: 600px;
height: 600px;
position: fixed;
left: 50%;
top: 145px; /* as the top of wrapper */
margin-left: -300px;
margin-top: 0px;
background-image: url(../img/gradient.png);
background-repeat: no-repeat;
background-image: -webkit-gradient(radial, 0% 0%, 0% 100%, from(rgba(213,246,255,1)), to(rgba(213,246,255,0)));
background-image: -webkit-radial-gradient(50% 50%, 40% 40%, rgba(213,246,255,1), rgba(213,246,255,0));
background-image: -moz-radial-gradient(50% 50%, 50% 50%, rgba(213,246,255,1), rgba(213,246,255,0));
background-image: -ms-radial-gradient(50% 50%, 50% 50%, rgba(213,246,255,1), rgba(213,246,255,0));
background-image: -o-radial-gradient(50% 50%, 50% 50%, rgba(213,246,255,1), rgba(213,246,255,0));
}
jsFiddle
Update:
as the #Atul you can use position:relative for #wrapper1 too. look at this code:
#wrapper1 {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
text-align: left;
text-decoration: none;
width: 300px;
height: 400px;
position: relative;
left: 50%;
margin-left: -150px;
}
jsFiddle
Since you position your inlogbox absolute it will overlap the menu at some point. (When the window size is smaller than the height of the menu and inlogbox together).
The only thing you can do is position your inlogbox static.
Therefor, change:
#wrapper1 {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight:300;
text-align: left;
text-decoration: none;
/* Center wrapper perfectly */
width: 300px;
height: 400px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -150px;
margin-top: -200px;
}
To:
#wrapper1 {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight:300;
text-align: left;
text-decoration: none;
width: 300px;
height: 400px;
margin: 0 auto;
}
The inlogbox will then be under the menu . If you want extra space between the menu and inlogbox, simply add a margin-top to the inlogbox.
Related
How to add text on countdown timer
I have the following code and am looking to give my Countdown timer a title. Inside the bar, right above the boxes that give the time remaining. Would like it to be easy to edit font, size and spacing across. Having trouble doing so. It also seems like when publishing this code, the padding for the variables: days, hours, mins, and secs get pushed down. Not centered under the boxes and the edge of the bottom of the countdown timer. var target_date = new Date("Aug 30, 2018 20:30:00").getTime(); // set the countdown date var days, hours, minutes, seconds; // variables for time units var countdown = document.getElementById("tiles"); // get tag element getCountdown(); setInterval(function() { getCountdown(); }, 1000); function getCountdown() { // find the amount of "seconds" between now and target var current_date = new Date().getTime(); var seconds_left = (target_date - current_date) / 1000; days = pad(parseInt(seconds_left / 86400)); seconds_left = seconds_left % 86400; hours = pad(parseInt(seconds_left / 3600)); seconds_left = seconds_left % 3600; minutes = pad(parseInt(seconds_left / 60)); seconds = pad(parseInt(seconds_left % 60)); // format countdown string + set tag value countdown.innerHTML = "<span>" + days + "</span><span>" + hours + "</span><span>" + minutes + "</span><span>" + seconds + "</span>"; } function pad(n) { return (n < 10 ? '0' : '') + n; } body { font: normal 13px/20px Arial, Helvetica, sans-serif; word-wrap: break-word; color: #eee; } #countdown { /*bar*/ width: 232.5px; /*changed*/ height: 56px; /*changed*/ text-align: center; background: #222; background-image: -webkit-linear-gradient(top, #264033, #feb330, #feb330, #264033); background-image: -moz-linear-gradient(top, #222, #333, #333, #222); background-image: -ms-linear-gradient(top, #222, #333, #333, #222); background-image: -o-linear-gradient(top, #222, #333, #333, #222); border: 1px solid #111; border-radius: 5px; box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.6); margin: auto; padding: 12px 0; /*changed*/ position: absolute; top: 0; bottom: 0; left: 0; right: 0; } #countdown:before { /*handles*/ content: ""; width: 4px; /*changed*/ height: 32.5px; /*changed*/ background: #444; background-image: -webkit-linear-gradient(top, #264033, #264033, #264033, #264033); /*changed*/ background-image: -moz-linear-gradient(top, #555, #444, #444, #555); background-image: -ms-linear-gradient(top, #555, #444, #444, #555); background-image: -o-linear-gradient(top, #555, #444, #444, #555); border: 1px solid #111; border-top-left-radius: 6px; border-bottom-left-radius: 6px; display: block; position: absolute; top: 24px; /*changed*/ left: -5px; /*changed*/ } #countdown:after { /*handles*/ content: ""; width: 4px; /*changed*/ height: 32.5px; /*changed*/ background: #444; background-image: -webkit-linear-gradient(top, #264033, #264033, #264033, #264033); /*changed*/ background-image: -moz-linear-gradient(top, #555, #444, #444, #555); background-image: -ms-linear-gradient(top, #555, #444, #444, #555); background-image: -o-linear-gradient(top, #555, #444, #444, #555); border: 1px solid #111; border-top-right-radius: 6px; border-bottom-right-radius: 6px; display: block; position: absolute; top: 24px; /*changed*/ right: -5px; } #countdown #tiles { position: relative; z-index: 1; } #countdown #tiles>span { /*box*/ width: 46px; /*changed*/ max-width: 46px; /*changed*/ font: bold 24px 'Droid Sans', Arial, sans-serif; /*changed*/ text-align: center; color: #000000; /*color of numbers*/ /*changed*/ background-color: #ddd; background-image: -webkit-linear-gradient(top, #111, #eee); /*color of box*/ /*changed*/ background-image: -moz-linear-gradient(top, #bbb, #eee); background-image: -ms-linear-gradient(top, #bbb, #eee); background-image: -o-linear-gradient(top, #bbb, #eee); border-top: 1px solid #fff; /*top border of box*/ /*changed*/ border-left: 1px solid #fff; /*left border of box*/ /*changed*/ border-right: 1px solid #fff; /*right border of box*/ /*changed*/ border-bottom: 1px solid #fff; /*bottom border of box*/ /*changed*/ border-radius: 3px; box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.7); margin: 0 3.5px; /*changed*/ padding: 9px 0; /*changed*/ display: inline-block; position: relative; } #countdown #tiles>span:before { /*mini-handles*/ content: ""; width: 100%; height: 13px; background: #000000; /*changed*/ display: block; padding: 0 3px; position: absolute; top: 41%; left: -3px; z-index: -1; } /* #countdown #tiles>span:after { content: ""; width: 100%; height: 1px; background: #eee; border-top: 1px solid #333; display: block; position: absolute; top: 48%; left: 0; } /*line through middle*/ #countdown .labels { /*words*/ width: 100%; height: 12.5px; /*changed*/ text-align: center; position: absolute; bottom: 8px; } #countdown .labels li { /*words*/ width: 51px; /*changed*/ font: bold 10px 'Droid Sans', Arial, sans-serif; color: #ffffff; /*changed*/ text-shadow: 1px 1px 0px #000; text-align: center; text-transform: uppercase; display: inline-block; } <div id="countdown"> <div id='tiles'></div> <div class="labels"> <li>Days</li> <li>Hours</li> <li>Mins</li> <li>Secs</li> </div> </div>
I was able to just add a new div above the #tiles div and tweak the CSS to get a title to display where you wanted. Needed to change the padding of #countdown to get it to display properly. <div id="countdown"> <div id='title'>Title</div> <div id='tiles'></div> <div class="labels"> <li>Days</li> <li>Hours</li> <li>Mins</li> <li>Secs</li> </div> </div> #countdown { /*bar*/ width: 232.5px; /*changed*/ height: 56px; /*changed*/ text-align: center; background: #222; background-image: -webkit-linear-gradient(top, #264033, #feb330, #feb330, #264033); background-image: -moz-linear-gradient(top, #222, #333, #333, #222); background-image: -ms-linear-gradient(top, #222, #333, #333, #222); background-image: -o-linear-gradient(top, #222, #333, #333, #222); border: 1px solid #111; border-radius: 5px; box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.6); margin: auto; padding: 0px 0px 32px 0; /*changed*/ position: absolute; top: 0; bottom: 0; left: 0; right: 0; } Here is a fiddle.
User profile error [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 8 years ago. Improve this question For some reason the css is not working I'm not sure where the problem is: This is how it's supposed to look: http://codepen.io/lukepeters/pen/DtzvE The JS FIDDLE: http://jsfiddle.net/Wc3RK/ I don't know what went wrong? The code is the same but it's coming out differen't on the JS Fiddle. CSS: html height: 100% body height: 100% //background: #a7d5cd +background-image(linear-gradient(#dddddd, #cccccc)) #people position: relative margin: 80px auto padding: 0 width: 480px font-family: 'Helvetica Neue', Helvetica, sans-serif font-size: 16px line-height: 22px color: #3b3b3b -webkit-font-smoothing: antialiased list-style-type: none li position: relative margin: 0 0 40px 0 padding: 10px 8px 8px 54px height: 42px border: 1px solid #bbbbbb border-radius: 4px box-shadow: 0 1px 3px rgba(0,0,0,0.06), inset 0 1px 0 #ffffff background: #f6f6f6 img position: absolute top: -16px left: -16px z-index: 10 margin: 0 padding: 4px width: 50px height: 50px border: 1px solid #bbbbbb box-shadow: 0 1px 0 #ffffff border-radius: 50% background: #ffffff h2 margin: 0 font-size: 18px line-height: 22px font-weight: 400 color: #4b4b4b text-shadow: -1px -1px 0 rgba(255,255,255,0.7) .info margin: 0 display: block em margin: 0 18px 0 0 font-size: 11px line-height: 20px font-weight: 400 font-style: normal letter-spacing: 1px text-transform: uppercase color: #5b5b5b float: left
You are using the sass code, not css. I compiled the sass code and forked your fiddle. Search sass on google. Click on sass in the first page(codepen) to see the compiled css http://jsfiddle.net/m52vb/ html { height: 100%; } body { height: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dddddd), color-stop(100%, #cccccc)); background-image: -webkit-linear-gradient(#dddddd, #cccccc); background-image: -moz-linear-gradient(#dddddd, #cccccc); background-image: -o-linear-gradient(#dddddd, #cccccc); background-image: linear-gradient(#dddddd, #cccccc); } #people { position: relative; margin: 80px auto; padding: 0; width: 480px; font-family: "Helvetica Neue", Helvetica, sans-serif; font-size: 16px; line-height: 22px; color: #3b3b3b; -webkit-font-smoothing: antialiased; list-style-type: none; } #people li { position: relative; margin: 0 0 40px 0; padding: 10px 8px 8px 54px; height: 42px; border: 1px solid #bbbbbb; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 white; background: #f6f6f6; } #people li img { position: absolute; top: -16px; left: -16px; z-index: 10; margin: 0; padding: 4px; width: 50px; height: 50px; border: 1px solid #bbbbbb; box-shadow: 0 1px 0 white; border-radius: 50%; background: white; } #people li h2 { margin: 0; font-size: 18px; line-height: 22px; font-weight: 400; color: #4b4b4b; text-shadow: -1px -1px 0 rgba(255, 255, 255, 0.7); } #people li .info { margin: 0; display: block; } #people li .info em { margin: 0 18px 0 0; font-size: 11px; line-height: 20px; font-weight: 400; font-style: normal; letter-spacing: 1px; text-transform: uppercase; color: #5b5b5b; float: left; }
No idea what it is, but it's not CSS. Correct CSS would be: html { height: 100%; } body { height: 100%; //background: #a7d5cd background-image(linear-gradient(#dddddd, #cccccc)) } #people { position: relative; margin: 80px auto; padding: 0; width: 480px; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 22px; color: #3b3b3b; -webkit-font-smoothing: antialiased; list-style-type: none; } li { position: relative; margin: 0 0 40px 0; padding: 10px 8px 8px 54px; height: 42px; border: 1px solid #bbbbbb; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.06), inset 0 1px 0 #ffffff; background: #f6f6f6; } img { position: absolute; top: -16px; left: -16px; z-index: 10; margin: 0; padding: 4px; width: 50px; height: 50px; border: 1px solid #bbbbbb; box-shadow: 0 1px 0 #ffffff; border-radius: 50%; } background: #ffffff; h2 { margin: 0; font-size: 18px; line-height: 22px; font-weight: 400; color: #4b4b4b; text-shadow: -1px -1px 0 rgba(255,255,255,0.7); } .info { margin: 0; display: block; } em { margin: 0 18px 0 0; font-size: 11px; line-height: 20px; font-weight: 400; font-style: normal; letter-spacing: 1px; text-transform: uppercase; color: #5b5b5b; float: left; } Updated fiddle.
OS X is messing with me css, how to fix
So I made a form and added styling with CSS, it looks fine on windows but when I go to the form with my Mac it looks diffrent, everything is smaller and has changed color. Why is OS X changing my CSS? And is there a way to fix this problem? Image of problem: http://i.tinyuploads.com/zq3rtp.png This problem happens in every browser on my Mac HTML Code: <p>Name:<span class="Req-ourForm">*</span></p> <input type="text" required="required" name="name"> <br /><br /> <p>Email:<span class="Req-ourForm">*</span></p> <input type="text" required="required" name="email"> <br /><br /> <p>Website:<span class="Req-ourForm">*</span></p> <input type="text" required="required" name="website"> <br /><br /> <p>Priority:<span class="Req-ourForm">*</span></p> <!--[if !IE]> --> <div class="notIE"> <!-- <![endif]--> <label /> <select class="pri" name="priority" size="1" required="required"> <option value="Low">Low</option> <option value="Normal">Normal</option> <option value="High">High</option> </select> <!--[if !IE]> --></div> <!-- <![endif]--> <br /> CSS Code: input, textarea { padding: 9px; border: solid 1px #C9C9C9; outline: 0; font: normal 13px/100% Verdana, Tahoma, sans-serif; width: 200px; background: #e2e2e2 url('bg_form.png') left top repeat-x; background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF)); background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px); box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; } input.sub { padding: 9px; border: solid 1px #C9C9C9; outline: 0; font: normal 13px/100% Verdana, Tahoma, sans-serif; width: 300px; background: #e2e2e2 url('bg_form.png') left top repeat-x; background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF)); background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px); box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; } input.captcha { padding: 9px; border: solid 1px #C9C9C9; outline: 0; font: normal 13px/100% Verdana, Tahoma, sans-serif; width: 45px; text-align: center; background: #e2e2e2 url('bg_form.png') left top repeat-x; background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF)); background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px); box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; } textarea { margin-top: 4px; width: 380px; max-width: 380px; max-height: 150px; height: 150px; line-height: 150%; } input:hover, textarea:hover, input:focus, textarea:focus { border-color: #b3b3b3; -webkit-box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 8px; #include box-shadow(0 0 5px rgba(81, 203, 238, 1)); border: 1px solid rgba(81, 203, 238, 1); } .form label { margin-left: 10px; color: #999999; } .submit input { width: auto; padding: 9px 15px; background: #617798; border: 0; font-size: 14px; color: #C9C9C9; -moz-border-radius: 5px; -webkit-border-radius: 5px; } /*CSS FOR DROP DOWN*/ label { position: relative; display: inline-block; } select { display: inline-block; padding: 4px 3px 5px 5px; width: 160px; outline: none; color: #74646e; border: 1px solid #C8BFC4; border-radius: 4px; box-shadow: inset 1px 1px 2px #ddd8dc; background-color: #fff; } select.pri { display: inline-block; padding: 4px 3px 5px 5px; width: 85px; outline: none; color: #74646e; border: 1px solid #C8BFC4; border-radius: 4px; box-shadow: inset 1px 1px 2px #ddd8dc; background-color: #fff; } select.aop { display: inline-block; padding: 4px 3px 5px 5px; width: 60px; outline: none; color: #74646e; border: 1px solid #C8BFC4; border-radius: 4px; box-shadow: inset 1px 1px 2px #ddd8dc; background-color: #fff; } select.stu { display: inline-block; padding: 4px 3px 5px 5px; width: 65px; outline: none; color: #74646e; border: 1px solid #C8BFC4; border-radius: 4px; box-shadow: inset 1px 1px 2px #ddd8dc; background-color: #fff; } Second issue is that the buttons are for some reason white instead of blue, IMG: http://i.tinyuploads.com/pW0E24.png HTML code of buttons: <button id="continue-link" class="button button rect" type="submit"> <span> <span class="effect"></span> <span class="label"> SEND </span> </span> </button> <button id="continue-link" class="button button rect" type="reset"> <span> <span class="effect"></span> <span class="label"> CLEAR ALL </span> </span> </button> CSS of buttons: /*BUTTON DESIGN*/ .button { background-color: transparent; border: 0 none; border-collapse: separate; cursor: pointer; display: inline-block; font: 11px/1.5 "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; overflow: visible; position: relative; } .button > span { background: url("common/src/store/base/patterns/buttons/css/bg/button_colors.png") repeat-x scroll 0 0 / 8px 22px #224272; border: 1px solid #224272; border-radius: 11px 11px 11px 11px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); color: white; display: inline-block; font: 12px/1 "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,sans-serif; letter-spacing: 0; opacity: 1; padding: 4px 25px; position: relative; text-align: center; transition: opacity 800ms ease 0s; white-space: nowrap; word-spacing: 0; } .button:-moz-focusring { outline: 0px dotted; } .ns .button, .button.rect { background: linear-gradient(#37AAEA, #117ED2) repeat scroll 0 0 transparent; border: 1px solid #1992D9; border-radius: 4px 4px 4px 4px; /*BUTTON ROUNDNESS*/ box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset; } .ns .button:hover, .ns .button:focus, .button.rect:hover, .button.rect:focus { background: linear-gradient(#2F90D5, #0351B7) repeat scroll 0 0 transparent; } .ns .button:active, .ns .button.active, .button.rect:active, .button.rect.active { box-shadow: 0 1px 0 #FFFFFF, 0 0 9px rgba(0, 0, 0, 0.5) inset; } .ns .button > span, .button.rect > span { background: none repeat scroll 0 center transparent; border: 0 none; border-radius: 4px 4px 4px 4px; box-shadow: none; color: #FFFFFF; font-size: 13px; line-height: 15px; padding: 4px 20px; /*BUTTON SIZE*/ }
The reason your button is not blue is because you are not declaring a webkit gradient. I had a look at your stylesheet. Add the correct prefix for various browsers as below - .ns .button, .button.rect { background: linear-gradient(#37AAEA, #117ED2) repeat scroll 0 0; background: linear-gradient(#37AAEA, #117ED2) repeat scroll 0 0; background: -moz-linear-gradient(#37AAEA, #117ED2) repeat scroll 0 0; background: -webkit-linear-gradient(#37AAEA, #117ED2) repeat scroll 0 0; background: -o-llinear-gradient(#37AAEA, #117ED2) repeat scroll 0 0; filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */ border: 1px solid #1992D9; border-radius: 4px 4px 4px 4px; /*BUTTON ROUNDNESS*/ box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset; -webkit-appearance: none; } This ensures your gradient will work on all browsers that support it.
Search box CSS problems
I'm newbie. And I try to make a search box. When I open it on Firefox. It's okay for me. Then I do it in IE, Chrome and Safari. It's not cool actually. Anyone know my problems, please help me fix it? I want make a search box like this: http://www.behance.net/gallery/Anthracite-EIKON/7171451 <div id="search-box"> <input type="text" name="search" placeholder="Search..."/> </div> And CSS: *{ margin: 0; padding: 0; } #search-box{ background: -moz-linear-gradient(top right, #353535, #010101); background: -webkit-linear-gradient(top right, #353535, #010101); background: -ms-linear-gradient(top right, #353535, #010101); background: -o-linear-gradient(top right, #353535, #010101); background: linear-gradient(top right, #353535, #010101); padding: 30px 0; position: relative; } input { font-family: Cambria, 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; color: #bebebe; font-weight: 400; line-height: 56px; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5) ; border-radius: 13px; border: 1px solid #000000; background-clip: border-box; padding: 5px 4px 3px 24px; width: 94px; height: 27px; box-shadow: 0 0 9px #121212 inset; position: absolute; right: 25px; top: 15; background-color: #444444 ; background-image: url('images/search_icon.png'); background-repeat: no-repeat; background-size: 12px 12px; background-position: 9px 8px; } input:hover { box-shadow: none; } input:focus { width: 200px; box-shadow: none; text-shadow: none; color: #4D4E52; background-color: white ; background-image: url('images/search_icon5.png'); background-repeat: no-repeat; background-position: 9px 8px; }
In your css for input you need to change top:15 to top:15px and change line-height to 24px; Example: http://jsfiddle.net/justincook/sMG3R/
Strange Border in login form after compiling
After forking a CodePen, I redesigned part of it, and it renders perfectly at the CodePen, but after running it through CodeKit, it looks weird, see the border in the middle of the two fields? Compiled CSS: * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } body { background: #E2E2E2; margin: 0; padding: 0; font-family: "Lato", sans-serif; } .login-form-wrap { background: #8fc400; border: 1px solid #8fc400; box-shadow: 0 1px #8fc400 inset, 0 0 10px 5px rgba(0, 0, 0, 0.1); border-radius: 5px; position: relative; width: 360px; height: 380px; margin: 60px auto; padding: 50px 30px 0 30px; text-align: center; } .login-form-wrap:before { background: url(http://cs6265.userapi.com/u155567463/docs/ad0e8d87e888/OSX-Buttons.png); display: block; content: ''; width: 58px; height: 19px; top: 10px; left: 10px; position: absolute; } .login-form-wrap > h1 { margin: 0 0 50px 0; padding: 0; font-size: 26px; color: #fff; } .login-form-wrap > h5 { margin-top: 40px; } .login-form-wrap > h5 > a { font-size: 14px; color: #fff; text-decoration: none; font-weight: 400; } .login-form input[type="email"], .login-form input[type="password"] { width: 100%; border: 1px solid; outline: none; padding: 12px 20px; color: #424647; font-weight: 400; font-family: "Lato", sans-serif; } .login-form input[type="email"] { border-radius: 4px 4px 0 0; padding-bottom: 13px; box-shadow: 0 -1px 0 #e0e0e0 inset, 0 1px 2px rgba(0, 0, 0, 0.23) inset; } .login-form input[type="password"] { border-top: none; border-radius: 0 0 4px 4px; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.23) inset, 0 1px 2px rgba(255, 255, 255, 0.1); } .login-form input[type="submit"] { font-family: "Lato", sans-serif; font-weight: 400; background: #e0e0e0; background: -moz-linear-gradient(top, #e0e0e0 0%, #cecece 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #e0e0e0), color-stop(100%, #cecece)); background: -webkit-linear-gradient(top, #e0e0e0 0%, #cecece 100%); background: -o-linear-gradient(top, #e0e0e0 0%, #cecece 100%); background: -ms-linear-gradient(top, #e0e0e0 0%, #cecece 100%); background: linear-gradient(to bottom, #e0e0e0 0%, #cecece 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e0e0e0', endColorstr='#cecece',GradientType=0 ); display: block; margin: 20px auto 0 auto; width: 100%; border: none; border-radius: 3px; padding: 8px; font-size: 17px; color: #636363; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); font-weight: 700; box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.17), 0 1px 0 rgba(255, 255, 255, 0.36) inset; } Screenshot:
Add normalize.css to your project.