I have a 3D button with different background styles. I want to set a small icon to it. But some ways it wont show and other ways the background colors changes or disappears
.button {
text-decoration: none;
color: white;
padding: 18px;
width:170px;
text-transform: uppercase;
display: inline-block;
text-shadow: -2px 2px 0 rgba(0, 0, 0, 0.2);
font-weight: bold;
padding-right: 50px;
margin: 10px;
margin-top:15px;
-moz-transition: all 0.1s linear;
-o-transition: all 0.1s linear;
-webkit-transition: all 0.1s linear;
transition: all 0.1s linear;
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-webkit-transform: translateZ(0);
transform: translateZ(0);
/*
Kinda replicates keyline but looks dumb.
#include filter(
drop-shadow(0 1px 0 rgba(blue, 0.2))
drop-shadow(0 -1px 0 rgba(blue, 0.2))
);
*/
}
.button.blue {
background: -moz-linear-gradient(top, #a2d3e9, #7abedf);
background: -webkit-linear-gradient(top, #a2d3e9, #7abedf);
background: linear-gradient(to bottom, #a2d3e9, #7abedf) ;
box-shadow: -1px 0px 1px #6fadcb, 0px 1px 1px #54809d, -2px 1px 1px #6fadcb, -1px 2px 1px #54809d, -3px 2px 1px #6fadcb, -2px 3px 1px #54809d, -4px 3px 1px #6fadcb, -3px 4px 1px #54809d, -5px 4px 1px #6fadcb, -4px 5px 1px #54809d, -6px 5px 1px #6fadcb, -6px 7px 0 rgba(0, 0, 0, 0.05), -5px 8px 0 rgba(0, 0, 0, 0.05), -3px 9px 0 rgba(0, 0, 0, 0.04), -2px 10px 0 rgba(0, 0, 0, 0.04), -1px 11px 0 rgba(0, 0, 0, 0.03), 0px 12px 0 rgba(0, 0, 0, 0.03), 1px 13px 0 rgba(0, 0, 0, 0.02), 2px 14px 0 rgba(0, 0, 0, 0.02), 3px 15px 0 rgba(0, 0, 0, 0.01), 4px 16px 0 rgba(0, 0, 0, 0.01), 5px 17px 0 rgba(0, 0, 0, 0.01), 6px 18px 0 rgba(0, 0, 0, 0.01), inset 0 4px 5px -2px rgba(255, 255, 255, 0.5), inset 0 1px 0 0 rgba(0, 0, 0, 0.3);
}
.button.yellow {
background: -moz-linear-gradient(top, #f2d851, #ecc92b);
background: -webkit-linear-gradient(top, #f2d851, #ecc92b);
background: linear-gradient(to bottom, #f2d851, #ecc92b);
color: black;
text-shadow: -2px 2px 0 rgba(255, 255, 255, 0.3);
box-shadow: -1px 0px 1px #d9b826, 0px 1px 1px #b1961d, -2px 1px 1px #d9b826, -1px 2px 1px #b1961d, -3px 2px 1px #d9b826, -2px 3px 1px #b1961d, -4px 3px 1px #d9b826, -3px 4px 1px #b1961d, -5px 4px 1px #d9b826, -4px 5px 1px #b1961d, -6px 5px 1px #d9b826, -6px 7px 0 rgba(0, 0, 0, 0.05), -5px 8px 0 rgba(0, 0, 0, 0.05), -3px 9px 0 rgba(0, 0, 0, 0.04), -2px 10px 0 rgba(0, 0, 0, 0.04), -1px 11px 0 rgba(0, 0, 0, 0.03), 0px 12px 0 rgba(0, 0, 0, 0.03), 1px 13px 0 rgba(0, 0, 0, 0.02), 2px 14px 0 rgba(0, 0, 0, 0.02), 3px 15px 0 rgba(0, 0, 0, 0.01), 4px 16px 0 rgba(0, 0, 0, 0.01), 5px 17px 0 rgba(0, 0, 0, 0.01), 6px 18px 0 rgba(0, 0, 0, 0.01), inset 0 4px 5px -2px rgba(255, 255, 255, 0.5), inset 0 1px 0 0 rgba(0, 0, 0, 0.3);
}
.button.yellow:after, .button.yellow:before {
background: black;
}
.button.yellow:after {
-webkit-filter: drop-shadow(-2px 0 0 rgba(255, 255, 255, 0.4));
filter: drop-shadow(-2px 0 0 rgba(255, 255, 255, 0.4));
}
.button.yellow:before {
-webkit-filter: drop-shadow(0 -2px 0 rgba(255, 255, 255, 0.35));
filter: drop-shadow(0 -2px 0 rgba(255, 255, 255, 0.35));
}
.button.yellow .arrow {
-webkit-filter: drop-shadow(-2px 0 0 rgba(255, 255, 255, 0.4));
filter: drop-shadow(-2px 0 0 rgba(255, 255, 255, 0.4));
}
.button:active {
box-shadow: none;
-moz-transform: translate3d(-6px, 6px, 0);
-ms-transform: translate3d(-6px, 6px, 0);
-webkit-transform: translate3d(-6px, 6px, 0);
transform: translate3d(-6px, 6px, 0);
}
.button .arrow {
-webkit-filter: drop-shadow(-2px 0 0 rgba(0, 0, 0, 0.2));
filter: drop-shadow(-2px 0 0 rgba(0, 0, 0, 0.2));
}
.button:after {
-webkit-filter: drop-shadow(-2px 0 0 rgba(0, 0, 0, 0.2));
filter: drop-shadow(-2px 0 0 rgba(0, 0, 0, 0.2));
}
.button:after, .button:before {
position: absolute;
content: " ";
right: 15px;
top: 14px;
width: 6px;
height: 18px;
background: white;
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
display: block;
z-index: 2;
}
.button:before {
height: 14px;
top: 26px;
right: 16px;
z-index: 3;
-moz-transform: rotate(-137deg);
-ms-transform: rotate(-137deg);
-webkit-transform: rotate(-137deg);
transform: rotate(-137deg);
-webkit-filter: drop-shadow(0 -2px 0 rgba(0, 0, 0, 0.15));
filter: drop-shadow(0 -2px 0 rgba(0, 0, 0, 0.15));
}
<div class="row">
CARDLESS<br>
VIDEO CONFERANCE<br>
</div>
when i add background: url();
to .button.blue {}
if i add it before the last background nothing happens
if i add it after it , the background color disappear and the image appear
Try this
background: linear-gradient( rgba(122, 122, 126, 1), rgba(122, 122, 126, 0.65) ), url(../images/bg/bg10.jpg) no-repeat top center fixed;
i added this to html and it worked
<div class="" style="height:13%;width:100%;bottom:0;left:0;position:absolute;opacity:1;background-color:Silver;z-index:1000">
<div class="row">
<a href="#" class="button blue" onclick="javascript:onKeyPress('B')">
<img src="images/gesture.png" style="position:absolute;right:50;width:50px;height:50px;top:02;background-color:" alt="">CARDLESS<br>
</a>
<a href="#" class="button yellow" >
<img src="images/call.png" style="position:absolute;right:50;width:50px;height:50px;top:02;background-color:" alt=""> VIDEO CONFERANCE<br>
</a>
</div>
Related
I have these beautiful push buttons:
body {
background: #555;
padding: 100px 300px;
}
.level-buttons {
display: flex;
flex-direction: row;
justify-content: center;
}
.level-buttons .pusher {
margin: 2px;
padding: 15px 80px 12px 80px;
border-radius: 5px;
background: -webkit-linear-gradient(top, #cc0000 0%, #990000 100%);
color: rgba(255, 255, 255, 0.7);
font-family: sans-serif;
text-decoration: none;
text-shadow: 0 -1px 0 maroon;
border: 2px solid black;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), 0 2px 2px rgba(0, 0, 0, 0.7), 0 0 8px rgba(255, 255, 255, 0.1), 0 -1px 0 rgba(0, 0, 0, 0.7), inset 0 3px 1px #ff1a1a, inset 0 9px 1px -5px rgba(255, 255, 255, 0.8);
/* edge-highlight*/
}
.level-buttons .pusher:hover {
background: -webkit-radial-gradient(50% 65%, ellipse closest-corner, #e60000 0%, #cc0000 80%, #b30000 100%);
box-shadow: 0 0 50px rgba(255, 51, 51, 0.6), 0 2px 6px rgba(0, 0, 0, 0.7), 0 2px 2px rgba(0, 0, 0, 0.7), 0 0 8px rgba(255, 255, 255, 0.1), 0 -1px 0 rgba(0, 0, 0, 0.7), inset 0 3px 1px #f50000, inset 0 9px 1px -5px rgba(255, 255, 255, 0.6), inset 0 6px 3px 1px #990000;
/* inner color*/
}
.level-buttons .pusher:active {
background: -webkit-radial-gradient(center, ellipse cover, #e60000 0%, #cc0000 80%, #b30000 100%);
box-shadow: 0 0 20px rgba(255, 51, 51, 0.4), 0 0 2px rgba(0, 0, 0, 0.7), 0 0 8px rgba(255, 255, 255, 0.1), 0 -1px 0 rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
/* edge-highlight 1*/
}
<div class="level-buttons">
Pusher
Pusher
Pusher
</div>
I tried to invert the shadows vertically in order to get the illusion we are looking at them from above with no luck!
How can we invert the shadows vertically in the proper way?
Edit: Here is what I mean by invert vertically:
I'm trying to have two different color buttons. When I tried, it makes the hover color for ".hicodestled" the hover color of ".styled. Also, the ".hicodestled" button is just idle when hovering on it. When trying to add different classes, it still does not distinguish the two buttons.
.styled {
float: right;
border: 0;
line-height: 1.5;
padding: 0 20px;
font-size: 1rem;
text-align: center;
color: #fff;
text-shadow: 1px 1px 1px #000;
border-radius: 10px;
background-color: rgba(0, 220, 0, 1);
background-image: linear-gradient(to top left, rgba(0, 0, 0, .2), rgba(0, 0, 0, .2) 30%, rgba(0, 0, 0, 0));
box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .6), inset -2px -2px 3px rgba(0, 0, 0, .6);
}
.styled:hover {
background-color: rgba(0, 255, 0, 1);
}
.styled:active {
box-shadow: inset -2px -2px 3px rgba(255, 255, 255, .6), inset 2px 2px 3px rgba(0, 0, 0, .6);
}
.hicodestled {
float: right;
border: 0;
line-height: 1.5;
padding: 0 20px;
font-size: 1rem;
text-align: center;
color: #fff;
text-shadow: 1px 1px 1px #000;
border-radius: 10px;
background-color: rgba(0, 220, 220, 1);
background-image: linear-gradient(to top left, rgba(0, 0, 0, .2), rgba(0, 0, 0, .2) 30%, rgba(0, 0, 0, 0));
box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .6), inset -2px -2px 3px rgba(0, 0, 0, .6);
}
.styled:hover {
background-color: rgba(0, 220, 220, 1);
}
.styled:active {
box-shadow: inset -2px -2px 3px rgba(255, 255, 255, .6), inset 2px 2px 3px rgba(0, 0, 0, .6);
}
<a href="http://point90.42web.io" style="text-decoration: none;">
<font color="#ffffff">
<button class="styled" type="button">
<b>Back up</b>
</button>
<button class="hicodestled" type="button">
<b>View code</b>
</button>
</font>
</a>
Edit: I now realize this is a garbage question as I was not looking at the CSS.
this seems to be a problem with the overwriting of the hicodestled button class. In the code below i changed the hover color and replaced the second styled button declaration for hicodestled. The code works as it should now but the colors are currently set to red and a darker shade of green for testing purposes. I suggest you change those according to your needs.
<style>
.styled {
float: right;
border: 0;
line-height: 1.5;
padding: 0 20px;
font-size: 1rem;
text-align: center;
color: #fff;
text-shadow: 1px 1px 1px #000;
border-radius: 10px;
background-color: rgba(0, 220, 0, 1);
background-image: linear-gradient(to top left,
rgba(0, 0, 0, .2),
rgba(0, 0, 0, .2) 30%,
rgba(0, 0, 0, 0));
box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .6),
inset -2px -2px 3px rgba(0, 0, 0, .6);
}
.styled:hover {
background-color: red
}
.styled:active {
box-shadow: inset -2px -2px 3px rgba(255, 255, 255, .6),
inset 2px 2px 3px rgba(0, 0, 0, .6);
}
.hicodestled {
float: right;
border: 0;
line-height: 1.5;
padding: 0 20px;
font-size: 1rem;
text-align: center;
color: #fff;
text-shadow: 1px 1px 1px #000;
border-radius: 10px;
background-color: rgba(0, 220, 220, 1);
background-image: linear-gradient(to top left,
rgba(0, 0, 0, .2),
rgba(0, 0, 0, .2) 30%,
rgba(0, 0, 0, 0));
box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .6),
inset -2px -2px 3px rgba(0, 0, 0, .6);
}
.hicodestled:hover {
background-color: green;
}
.hicodestled:active {
box-shadow: inset -2px -2px 3px rgba(255, 255, 255, .6),
inset 2px 2px 3px rgba(0, 0, 0, .6);
}
</style>
<a href=http://point90.42web.io style=text-decoration:none><font color=#ffffff>
<button class="styled"
type="button">
<b>Back up</b>
</button>
<button class="hicodestled"
type="button">
<b>View code</b>
</button>
</font></a>
I'm trying to style a div that I shaped with the clip-path: polygon CSS property. I want to give it some shadows so it looks a bit three dimensional.
The problem is that the shadow property doesn't work. When I inspect the element in the browser, the CSS code for shadow is grayed out.
I tried to make the shadow the following ways and none of them worked
box-shadow: 0 -2px 2px 0 rgba(0, 0, 0, 0.14), 0 -3px 1px -2px rgba(0,
0, 0, 0.12), 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
filter: drop-shadow(0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px
rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2));
filter: box-shadow 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px
rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
Here is the HTML code:
<div id="first" class="row">
<div class="container-fluid">
...some content inside...
</div>
</div>
And SCSS code:
#first {
padding-top: 60px;
padding-bottom: 30px;
-webkit-box-shadow: 0 -2px 2px 0 rgba(0, 0, 0, 0.14), 0 -3px 1px -2px rgba(0, 0, 0, 0.12), 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
box-shadow: 0 -2px 2px 0 rgba(0, 0, 0, 0.14), 0 -3px 1px -2px rgba(0, 0, 0, 0.12), 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
.container-fluid {
background: red;
clip-path: polygon(0 0%, 100% 0%, 100% 88%, 0 100%);
}
}
Try instead with filter: drop-shadow()
#first {
padding-top: 60px;
padding-bottom: 30px;
filter: drop-shadow(4px 4px 1px rgba(0, 0, 0, 0.3));
}
#first .container-fluid {
background: red;
clip-path: polygon(0 0%, 100% 0%, 100% 88%, 0 100%);
}
<div id="first" class="row">
<div class="container-fluid">
...some content inside...
</div>
</div>
It's working fine. Try changing the h-offset, v-offset, blur spread, color
#first {
padding-top: 60px;
padding-bottom: 30px;
/*-webkit-box-shadow: 0 -9px 9px 0 rgba(0, 0, 0, 0.14), 0 -3px 1px -2px rgba(0, 0, 0, 0.12), 0 -1px 5px 0 rgba(0, 0, 0, 0.2);*/
/*box-shadow: 0 -2px 2px 0 rgba(0, 0, 0, 0.14), 0 -3px 1px -2px rgba(0, 0, 0, 0.12), 0 -1px 5px 0 rgba(0, 0, 0, 0.2);*/
-webkit-box-shadow: 5px 10px 18px rgba(0, 0, 0, 0.14), 5px 10px 18px rgba(0, 0, 0, 0.12), 5px 10px 18px rgba(0, 0, 0, 0.2);
box-shadow: 5px 10px 18px rgba(0, 0, 0, 0.14), 5px 10px 18px rgba(0, 0, 0, 0.12), 5px 10px 18px rgba(0, 0, 0, 0.2);
}
.container-fluid {
background: red;
clip-path: polygon(0 0%, 100% 0%, 100% 88%, 0 100%);
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<div id="first" class="row">
<div class="container-fluid">
...some content inside...
</div>
</div>
I found this example since this style in good so i inserted in my project
following example is search box in html & css
ERROR only in chrome, safari
works good in firefox
when i click(focus) on search box it works as styled but a blue border line appear when clicked i don't want the blue border when i click on input box i tried remove shadow still no success
.wrap{position: absolute;
text-align: center;
top: 50%;
-webkit-transform: translate(0%,-50%);
-moz-transform: translate(0%,-50%);
transform: translate(0%,-50%);}
.se {
margin-left:50px;
}
#search input[type="text"] {
background: url(search-white.png) no-repeat 10px 6px #444;
border: 0 none;
font: bold 12px Arial,Helvetica,Sans-serif;
color: #d7d7d7;
width:150px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7s ease 0s;
}
#search input[type="text"]:focus {
background: url(search-dark.png) no-repeat 10px 6px #fcfcfc;
color: #6a6f75;
width: 200px;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.5) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.5) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.5) inset;
text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}
<div class="wrap se">
<form method="get" action="/search" id="search">
<input name="q" type="text" size="40" placeholder="Search..." />
</form>
</div>
set outline: none on the input to remove chrome's input highlighting
#search input[type="text"]{
outline: none;
}
FIDDLE
I want to position multiple link buttons around an background image. Here is the HTML:
<body>
<div id="background">
<div id="abt">About Us</div>
<div id="ofc">Office</div>
<div id="staf">Staff</div>
<div id="msg">Message</div>
</div>
</body>
I want to position them around the background so that they stay fixed.
Example: http://jsfiddle.net/kimonante/2cvz4/1/
body {
background:url(http://www.factoryoutletstores.info/img/usa-map.gif) no-repeat;
background-attachment:fixed;
/*fix the shit*/
background-position:center;
}
.button-link {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: solid 1px #20538D;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
padding: 10px 25px;
background: #0d0f12;
color: #FFF;
font-family:arial;
font-weight:600;
display:block;
}
.button-link:hover, .button-link:focus {
background: #356094;
border: solid 1px #2A4E77;
text-decoration: none;
}
.button-link:active {
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
background: #2E5481;
border: solid 1px #203E5F;
}
a {
text-decoration:none;
color:white;
width:100px;
text-transform:uppercase;
padding-left:18px;
}
#abt {
margin-left:540px;
margin-top:200px;
}
#ofc {
margin-left:160px;
margin-top:105px;
}
#msg {
margin-left:930px;
margin-top:-240px;
}
#staf {
margin-left:360px;
margin-top:260px;
}
As your buttons are positioned by pixels, you need to set your div#background to a fixed size and set the background to the div#background instead of the body.
Also remove the background attachement. This version works: http://jsfiddle.net/BTVZz/