Related
I am working on a transparent menu for my site.This is my current code
nav{
display: inline-block;
position:overlay;
top:0;
left:0;
width:100%;
height:80px;
padding: 10px 90px;
box-sizing: border-box;
background: rgba(0,0,0,.5);
}
I want the menu to be transparent like this site
https://www.holeman-finch.com.
Thanks in advance
nav{
display: inline-block;
position:overlay;
top:0;
left:0;
width:100%;
height:80px;
padding: 10px 90px;
box-sizing: border-box;
background: rgba(0,0,0,.5);
margin-bottom:-80px
}
nav{
display: inline-block;
position: overlay;
top:0;
left:0;
width:100%;
height:80px;
padding: 10px 90px;
box-sizing: border-box;
background-color: transparent;
}
On your header element, you can use any transparent background color, for example a very light white transparent shade which will work fine as an overlay on a darker photo:
background-color: #ffffff42;
In order for your header to actually float on top of the photo behind it, add position: fixed; or position: sticky; to it, for example. The same effect can also be achieved with position: absolute; and some extra top, right and left properties.
nav {
max-width: 960px;
/* The mask-image gives us some extra fading. It is not necessary but without this, you can't face out the box-shadows. This clips our menu */
mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 25%, #ffffff 75%, rgba(255, 255, 255, 0) 100%);
margin: 0 auto;
/* Using padding instead of margin for the top and bottom here will keep our box-shadow visible and not affected by the mask-image */
padding: 75px 0;
}
nav ul {
text-align: center;
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
width: 100%;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
nav ul li {
display: inline-block;
}
nav ul li a {
padding: 20px;
font-family: "Roboto";
color: rgba(0, 0, 0, 0.5);
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.4);
font-size: 25px;
text-decoration: none;
display: block;
}
This is a quite famous checkout bar / progress bar:
http://codepen.io/whqet/pen/EJgwb/
HTML:
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700' rel='stylesheet' type='text/css'>
<h1>Responsive Checkout Progress Bar</h1>
<! -- To test add 'active' class and 'visited' class to different li elements -->
<div class="checkout-wrap">
<ul class="checkout-bar">
<li class="visited first">
Login
</li>
<li class="previous visited">Shipping & Billing</li>
<li class="active">Shipping Options</li>
<li class="next">Review & Payment</li>
<li class="">Complete</li>
</ul>
</div>
CSS
#-webkit-keyframes myanimation {
from {
left: 0%;
}
to {
left: 50%;
}
}
h1 {
text-align: center;
font-family: 'PT Sans Caption', sans-serif;
font-weight: 400;
font-size: 30px;
padding: 20px 0;
color: #777;
}
.checkout-wrap {
color: #444;
font-family: 'PT Sans Caption', sans-serif;
margin: 40px auto;
max-width: 1200px;
position: relative;
}
ul.checkout-bar {
margin: 0 20px;
}
ul.checkout-bar li {
color: #ccc;
display: block;
font-size: 16px;
font-weight: 600;
padding: 14px 20px 14px 80px;
position: relative;
}
ul.checkout-bar li:before {
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
background: #ddd;
border: 2px solid #FFF;
border-radius: 50%;
color: #fff;
font-size: 16px;
font-weight: 700;
left: 20px;
line-height: 37px;
height: 35px;
position: absolute;
text-align: center;
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
top: 4px;
width: 35px;
z-index: 999;
}
ul.checkout-bar li.active {
color: #8bc53f;
font-weight: bold;
}
ul.checkout-bar li.active:before {
background: #8bc53f;
z-index: 99999;
}
ul.checkout-bar li.visited {
background: #ECECEC;
color: #57aed1;
z-index: 99999;
}
ul.checkout-bar li.visited:before {
background: #57aed1;
z-index: 99999;
}
ul.checkout-bar li:nth-child(1):before {
content: "1";
}
ul.checkout-bar li:nth-child(2):before {
content: "2";
}
ul.checkout-bar li:nth-child(3):before {
content: "3";
}
ul.checkout-bar li:nth-child(4):before {
content: "4";
}
ul.checkout-bar li:nth-child(5):before {
content: "5";
}
ul.checkout-bar li:nth-child(6):before {
content: "6";
}
ul.checkout-bar a {
color: #57aed1;
font-size: 16px;
font-weight: 600;
text-decoration: none;
}
#media all and (min-width: 800px) {
.checkout-bar li.active:after {
-webkit-animation: myanimation 3s 0;
background-size: 35px 35px;
background-color: #8bc53f;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
content: "";
height: 15px;
width: 100%;
left: 50%;
position: absolute;
top: -50px;
z-index: 0;
}
.checkout-wrap {
margin: 80px auto;
}
ul.checkout-bar {
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
background-size: 35px 35px;
background-color: #EcEcEc;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent);
border-radius: 15px;
height: 15px;
margin: 0 auto;
padding: 0;
position: absolute;
width: 100%;
}
ul.checkout-bar:before {
background-size: 35px 35px;
background-color: #57aed1;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
border-radius: 15px;
content: " ";
height: 15px;
left: 0;
position: absolute;
width: 10%;
}
ul.checkout-bar li {
display: inline-block;
margin: 50px 0 0;
padding: 0;
text-align: center;
width: 19%;
}
ul.checkout-bar li:before {
height: 45px;
left: 40%;
line-height: 45px;
position: absolute;
top: -65px;
width: 45px;
z-index: 99;
}
ul.checkout-bar li.visited {
background: none;
}
ul.checkout-bar li.visited:after {
background-size: 35px 35px;
background-color: #57aed1;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
content: "";
height: 15px;
left: 50%;
position: absolute;
top: -50px;
width: 100%;
z-index: 99;
}
}
The thing is, the animation defined under webkit frames does not work for me in chrome.
Is there a way to make it work? Maybe even crossbrowser?
animation syntax animation: myanimation 3s 0;
can fixed with animation: myanimation 3s 0s;
You can use only unprefix rules for animations and gradients. You may add also the prefixed version before unprefixed ones.
http://codepen.io/gc-nomade/pen/ZWZXqp
I have issues with changing the CSS for the progress bar. Please review the attached image.
I would like to have the progress bar with all 10 values in one horizontal line.
I am including the script in to the html.
CSS Script:
<style>
#-webkit-keyframes myanimation {
from {
left: 0%;
}
to {
left: 50%;
}
}
h1 {
text-align: center;
font-family: 'PT Sans Caption', sans-serif;
font-weight: 400;
font-size: 20px;
padding: 20px 0;
color: #777;
}
.checkout-wrap {
color: #444;
font-family: 'PT Sans Caption', sans-serif;
margin: 40px auto;
max-width: 1200px;
position: relative;
}
ul.checkout-bar li {
color: #ccc;
display: block;
font-size: 16px;
font-weight: 600;
padding: 14px 20px 14px 80px;
position: relative;
}
ul.checkout-bar li:before {
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
background: #ddd;
border: 2px solid #FFF;
border-radius: 50%;
color: #fff;
font-size: 16px;
font-weight: 700;
left: 20px;
line-height: 37px;
height: 35px;
position: absolute;
text-align: center;
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
top: 4px;
width: 35px;
z-index: 999;
}
ul.checkout-bar li.active {
color: #8bc53f;
font-weight: bold;
}
ul.checkout-bar li.active:before {
background: #8bc53f;
z-index: 99999;
}
ul.checkout-bar li.visited {
background: #ECECEC;
color: #57aed1;
z-index: 99999;
}
ul.checkout-bar li.visited:before {
background: #57aed1;
z-index: 99999;
}
ul.checkout-bar li:nth-child(1):before {
content: "1";
}
ul.checkout-bar li:nth-child(2):before {
content: "2";
}
ul.checkout-bar li:nth-child(3):before {
content: "3";
}
ul.checkout-bar li:nth-child(4):before {
content: "4";
}
ul.checkout-bar li:nth-child(5):before {
content: "5";
}
ul.checkout-bar li:nth-child(6):before {
content: "6";
}
ul.checkout-bar li:nth-child(7):before {
content: "7";
}
ul.checkout-bar li:nth-child(8):before {
content: "8";
}
ul.checkout-bar li:nth-child(9):before {
content: "9";
}
ul.checkout-bar li:nth-child(10):before {
content: "10";
}
ul.checkout-bar a {
color: #57aed1;
font-size: 16px;
font-weight: 600;
text-decoration: none;
}
#media all and (min-width: 800px) {
.checkout-bar li.active:after {
-webkit-animation: myanimation 3s 0;
background-size: 35px 35px;
background-color: #8bc53f;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
content: "";
height: 15px;
width: 100%;
left: 50%;
position: absolute;
top: -50px;
z-index: 0;
}
.checkout-wrap {
margin: 80px auto;
}
ul.checkout-bar {
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
background-size: 35px 35px;
background-color: #EcEcEc;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent);
border-radius: 15px;
height: 15px;
margin: 0 auto;
padding: 0;
position: absolute;
width: 100%;
}
ul.checkout-bar:before {
background-size: 35px 35px;
background-color: #57aed1;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
border-radius: 15px;
content: " ";
height: 15px;
left: 0;
position: absolute;
width: 10%;
}
ul.checkout-bar li {
display: inline-block;
margin: 50px 0 0;
padding: 0;
text-align: center;
width: 19%;
}
ul.checkout-bar li:before {
height: 45px;
left: 40%;
line-height: 45px;
position: absolute;
top: -65px;
width: 45px;
z-index: 99;
}
ul.checkout-bar li.visited {
background: none;
}
ul.checkout-bar li.visited:after {
background-size: 35px 35px;
background-color: #57aed1;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
-webkit-box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
content: "";
height: 15px;
left: 50%;
position: absolute;
top: -50px;
width: 100%;
z-index: 99;
}
}
</style>
HTML:
</head>
<body>
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700' rel='stylesheet' type='text/css'/>
<h1></h1>
<div class="checkout-wrap">
<ul class="checkout-bar">
<li class="visited first">
Possible candidate
</li>
<li class="previous visited">Forwarded to manager</li>
<li class="previous visited">Phone screen</li>
<li class="previous visited">Interview</li>
<li class="previous visited">References</li>
<li class="previous visited">Medical Assessment</li>
<li class="previous visited">Backgroung Check</li>
<li class="previous visited">Offer</li>
<li class="previous visited">Hired</li>
<li class="active">Declined Offer</li>
</ul>
</div>
</body>
Alignment issue:
Try reducing the width of ul.checkout-bar li within the #media all and (min-width: 800px) { media query. It's currently 19% so you'll never get more than 5 on a row. Try 5% instead, and add vertical-align: top; to the same selector.
Fiddle: https://jsfiddle.net/yjz9Lzzg/
I want to make a "roll over text" when you hover the image container.
I did it fine, but only with position absolute, but i cant get it right with position relative.
Now the Text comes after the Image but i need the text as an small overlay to the bottom of the image
<div class="ce_image team block">
<figure class="image_container">
<img src="assets/images/c/De****-D1-6a7e730c.jpg" width="300" height="300" alt="">
<figcaption class="caption" style="width:300px">The text i want to display on hover</figcaption>
</figure>
</div>
css: (ps: i quess my css is really bad, never made smth like this)
.image_container {
position: relative;
display: inline-block;
padding: 0.75em;
border: 1px solid #b2b9c4;
border-radius: 2px;
background: #ffffff;
background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
background-image: -moz-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
background-image: -o-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.team .image_container figcaption, .team .image_container .caption {
width: 100% !important;
padding: 0.42857em 0 0;
font-size: 1.0em;
display: none !important;
display: fixed;
color: #000000;
font-weight: bold;
position: static !important;
text-align: center;
top: 100px;
z-index: 999;
opacity: 0;
transition: opacity 0.2s linear !important;
left: 0px;
background: rgba(255, 255, 255, 0.9);
position: relative;
}
.team .image_container:hover figcaption, .team .image_container:hover .caption {
width: 100% !important;
padding: 0.42857em 0 0;
font-size: 1.0em;
color: #000000;
font-weight: bold;
text-align: center;
top: -31px;
z-index: 999;
opacity: 1;
left: 0px;
background: rgba(255, 255, 255, 0.9);
position: relative;
display: block !important;
}
Fiddle with css here:
https://jsfiddle.net/vm73gfhn/
I updated some of your CSS so that the text sits at the bottom. You need position absolute rather than position relative:
.image_container {
position: relative;
display: inline-block;
padding: 0.75em;
border: 1px solid #b2b9c4;
border-radius: 2px;
background: #ffffff;
background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
background-image: -moz-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
background-image: -o-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.02));
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.team .image_container figcaption, .team .image_container .caption {
display: none !important;
}
.team .image_container:hover figcaption, .team .image_container:hover .caption {
width: 100% !important;
padding: 0.42857em 0 0;
font-size: 1.0em;
color: #000000;
font-weight: bold;
text-align: center;
bottom: 0px;
z-index: 999;
opacity: 1;
left: 0px;
background: rgba(255, 255, 255, 0.9);
position: absolute;
display: block !important;
}
JSFIDDLE
Additional
If you want it to work for mobile and tablets then use media queries:
http://www.w3schools.com/cssref/css3_pr_mediaquery.asp
here is design of my button (different backgrounds for example, zoom ~1500% and actual size). how can i do it with single element and some css3, or minimum of additional elements? css guru, anyone?
http://ompldr.org/vZjBudQ/button.png
HTML
CSS
.button {
position: relative;
z-index: 1;
display: block;
width: 22px;
height: 22px;
background: -webkit-linear-gradient(#f5f0ee, #e7ddd7);
background: -ms-linear-gradient(#f5f0ee, #e7ddd7);
background: -moz-linear-gradient(#f5f0ee, #e7ddd7);
background: linear-gradient(#f5f0ee, #e7ddd7);
border: 1px solid #c0b9b3;
border-radius: 3px;
box-shadow: inset 0px 1px #fcfbfb, 0px 1px rgba(0, 0, 0, 0.3);
}
.button:before {
content: "";
position: absolute;
left: -4px;
top: -4px;
z-index: -1;
padding: 4px;
width: 22px;
height: 22px;
background: -webkit-linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
background: -ms-linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
background: -moz-linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
background: linear-gradient(#f5f0ee, #e7ddd7);
border-radius: 3px;
box-shadow: 0px 1px rgba(255, 255, 255, 0.3);
}
JSFiddle.
I think the only thing I couldn't get was the border with gradient.