The top of the button seems to have a default shadow when clicked you can see in the Codepen example the gold border gets darker around the top rim - how do I remove this behaviour?
Example
.button {
cursor:pointer;
height: 3rem;
width:10rem;
margin:15px;
font-size:2em;
font-family: Helvetica, Arial, Sans-Serif;
background: linear-gradient(to bottom, rgba(76,76,76,1) 0%,rgba(89,89,89,1) 9%,rgba(102,102,102,1) 20%,rgba(71,71,71,1) 34%,rgba(71,71,71,1) 34%,rgba(44,44,44,1) 45%,rgba(0,0,0,1) 54%,rgba(17,17,17,1) 60%,rgba(43,43,43,1) 76%,rgba(28,28,28,1) 91%,rgba(19,19,19,1) 100%);
text-decoration:none;
border-radius:10rem;
border-color:#fcbd3f ;
border-width: 1.5px;
color:#d4d6d8 ;
box-shadow: 0px 17px 10px -10px rgba(0,0,0,0.4);
outline: none;
&:active{
outline: none;
box-shadow: inset 0px 7px 10px -10px;
background: linear-gradient(to bottom, rgba(76,76,76,1) 0%,rgba(0,0,0,1) 16%,rgba(17,17,17,1) 51%,rgba(28,28,28,1) 70%,rgba(28,28,28,1) 70%,rgba(44,44,44,1) 82%,rgba(43,43,43,1) 82%,rgba(56,56,56,1) 82%,rgba(44,44,44,1) 82%,rgba(66,66,66,1) 84%,rgba(84,84,84,1) 91%,rgba(109,109,109,1) 92%,rgba(102,102,102,1) 98%,rgba(28,28,28,1) 100%,rgba(19,19,19,1) 100%);
}
&:hover{
color: white;
outline: none;
}
}
button:active{
outline: none;
box-shadow: inset 0px 7px 10px -10px;
background: linear-gradient(to bottom, rgba(76,76,76,1) 0%,rgba(0,0,0,1) 16%,rgba(17,17,17,1) 51%,rgba(28,28,28,1) 70%,rgba(28,28,28,1) 70%,rgba(44,44,44,1) 82%,rgba(43,43,43,1) 82%,rgba(56,56,56,1) 82%,rgba(44,44,44,1) 82%,rgba(66,66,66,1) 84%,rgba(84,84,84,1) 91%,rgba(109,109,109,1) 92%,rgba(102,102,102,1) 98%,rgba(28,28,28,1) 100%,rgba(19,19,19,1) 100%);
}
This code fixes your problem:
.button:active {
border-left-style: solid;
border-top-style: solid;
}
EDIT: or please check working codepen
The border you have on the button is the default border. Hou only adjusted the width and the color, not the style.
Therefore it's common practise to define a button like so:
border: 1.5px solid #fcbd3f;
Where solid is the style of the border.
I am trying to center the text "verksamheter" on my CSS3 button, but I can't get it to work.
HTML:
<span>Verksamheter</span>
CSS:
.verksamheter {
width: 220px;
height: 44px;
font-style: italic;
font-size: 18px;
display: inline-block;
text-align: center;
-webkit-border-radius: 22px;
-moz-border-radius: 22px;
border-radius: 22px;
background-color: #ebebeb;
-webkit-box-shadow: 0 1px rgba(0,0,0,.13), inset 0 2px rgba(255,255,255,.75);
-moz-box-shadow: 0 1px rgba(0,0,0,.13), inset 0 2px rgba(255,255,255,.75);
box-shadow: 0 1px rgba(0,0,0,.13), inset 0 2px rgba(255,255,255,.75);
border: solid 1px #4f4d6a;
background-image: -webkit-linear-gradient(top, #6e6c8a, #4f4d6a);
background-image: -moz-linear-gradient(top, #6e6c8a, #4f4d6a);
background-image: -o-linear-gradient(top, #6e6c8a, #4f4d6a);
background-image: -ms-linear-gradient(top, #6e6c8a, #4f4d6a);
background-image: linear-gradient(to bottom, #6e6c8a, #4f4d6a);
}
.verksamheter span {
vertical-align: middle;
}
The height of the <a> is 44px, so make the line-height of the text 44px as well.
http://jsfiddle.net/s4KJd/
Simply set the line-height property according to the height of the element and the font size used. For example:
.verksamheter {
line-height: 44px;
}
Here's a jsFiddle Demo.
I am using a webfont (poly) on my page on several buttons. In firefox, everything appears right, but in Chrome the first button's font seems bolder than the others despite using the same CSS3 code (unless I'm missing a typo).
http://ashgavs.cloudant.com/site/_design/AshGavsCouch/betcha/index.html
thats the page, look at Login vs. Login with facebook or Sign up. It's not the length of the text that's affecting the font weight, tested that already.
here's the CSS for the first and second buttons:
#login{
position: absolute;
top: 137px;
left: 19px;
padding-top: 10px;
padding-bottom: 10px;
border-top: 1px solid #aff797;
background: #369942;
background: -webkit-gradient(linear, left top, left bottom, from(#27ca3d), to(#369942));
background: -webkit-linear-gradient(top, #27ca3d, #369942);
background: -moz-linear-gradient(top, #27ca3d, #369942);
background: -ms-linear-gradient(top, #27ca3d, #369942);
background: -o-linear-gradient(top, #27ca3d, #369942);
-webkit-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 5px;
-webkit-box-shadow: rgba(0,0,0,.7) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,.7) 0 1px 0;
box-shadow: rgba(0,0,0,.7) 0 1px 0;
text-shadow: 0 1px 0 #91d99a;
color: #0e5817;
font-size: 24px;
font-family: 'Poly', serif;
text-decoration: none;
vertical-align: center;
width: 229px;
}
#loginFB{
position: absolute;
top: 196px;
left: 19px;
padding-top: 10px;
padding-bottom: 10px;
border-top: 1px solid #65a9d7;
background: #3e779d;
background: -webkit-gradient(linear, left top, left bottom, from(#65a9d7), to(#3e779d));
background: -webkit-linear-gradient(top, #65a9d7, #3e779d);
background: -moz-linear-gradient(top, #65a9d7, #3e779d);
background: -ms-linear-gradient(top, #65a9d7, #3e779d);
background: -o-linear-gradient(top, #65a9d7, #3e779d);
-webkit-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 5px;
-webkit-box-shadow: rgba(0,0,0,.7) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,.7) 0 1px 0;
box-shadow: rgba(0,0,0,.7) 0 1px 0;
text-shadow: 0 1px 0 #7ca9c7;
color: #0e3458;
font-size: 24px;
font-family: 'Poly', serif;
text-decoration: none;
vertical-align: center;
width: 229px;
}
Both buttons inherit properties from the same divs, so that can't be the issue either. Thanks.
--Ashley
It may be with your particular browser. Regardless, a very good thing to do (pretty much a requirement these days) is to add a CSS Reset before your own CSS definitions. Just Google "CSS Reset". You will see a lot of results. Basically it removes browser specific formatting so that your CSS is the only effective formatting on the page. No unexpected changes or additions from the browser. Often doing this will solve the kinds of issues you describe. You might want to research the idiosyncrasies of your browser, but to save time just try the reset first.
I need to move this navigation menu above the content box and below the logo. In other words, the order should be: (1) logo, (2) menu, and (3) content box.
I tried various margin adjustments to the CSS for #navigation to no avail.
How do I do this?
URL: http://ec2-174-129-169-80.compute-1.amazonaws.com/
See screenshot:
You could add top: -57px; to your #navigation CSS like so:
#navigation {
position: relative;
top: -57px;
clear: both;
margin-bottom: 3em;
display: none;
font: 14px/14px sans-serif;
border: 1px solid #D9D9D9;
background: white;
background: -webkit-gradient(linear, left top, left bottom, from(white), to(whiteSmoke));
background: -webkit-linear-gradient(white, whiteSmoke);
background: -moz-linear-gradient(center top, white 0%, whiteSmoke 100%);
background: -moz-gradient(center top, white 0%, whiteSmoke 100%);
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.03);
-webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.03);
-moz-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.03);
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
Make a jsFiddle or post your code please. Without seeing code, first thoughts are that you put the #navigation in the content area. If that's the case, then:
#navigation { margin-top: -50px; }
If #navigation is absolutely positioned:
#navigation { top: -50px; }
I have been making a button which (hopefully) looks fairly realistic. One part of this is having the text move down 1px inside the button when it is pressed. I've done this by adding an additional pixel to the top and removing one from the bottom.
Unfortunately, I've designed my button to work inline (inline-block) and when the button is "pushed" it means any text on the line also gets pushed down. Now I think I know why (presumably due to the baseline of the text) but I wonder if anyone knows how I can get the same "pushed" effect whilst keeping surrounding text in place. I would like to avoid floats if possible.
Anyway on with the code:
http://gard.me/xsfqH
HTML:
<a class="button noIcon smaller" href="#">Buy Now</a> hello world
CSS:
a.button {
margin: 20px;
display: inline-block;
padding: 12px 12px 12px 12px;
background: none;
background-repeat: no-repeat;
background-position: 9px 5px;
background-position: 9px 5px, 0 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border-width: 1px;
border-style: solid;
font-family: Verdana, Arial, Sans-Serif;
text-decoration: none;
}
a.button:active {
padding-top: 13px; padding-bottom: 11px;
-webkit-box-shadow: inset 0px 1px 6px -1px #000000;
-moz-box-shadow: inset 0px 1px 6px -1px #000000;
box-shadow: inset 0px 1px 6px -1px #000000;
}
a.button.noIcon {
color: #FFECEA;
background-position: 0 0;
background-color: #E46553;
background-image: -o-linear-gradient(bottom, #D15039 0%, #F27466 100%);
background-image: -moz-linear-gradient(bottom, #D15039 0%, #F27466 100%);
background-image: -webkit-linear-gradient(bottom, #D15039 0%, #F27466 100%);
background-image: -ms-linear-gradient(bottom, #D15039 0%, #F27466 100%);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #D15039), color-stop(1, #F27466));
border-color: #A03E33;
}
since it's inline-block you can use vertical-align.
so all you have to do is
a.button:active {
padding-top: 13px;padding-top:11px;
-webkit-box-shadow: inset 0px 1px 6px -1px #000000;
-moz-box-shadow: inset 0px 1px 6px -1px #000000;
box-shadow: inset 0px 1px 6px -1px #000000;
vertical-align:1px;
}
and problem solved