I have a navbar like this, please look the picture
this is the css code
.home-upperbar-row{
background-color: #ffffff;
z-index: 15;
position: -webkit-sticky;
position: sticky;
top: 0;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
width: unset;
height: 100%;
left: 1vw;
border-bottom-left-radius: 25px;
border-bottom-right-radius: 25px;
transform: scale(1,1) translate(0%,0%);
}
I want the red marked part in the top image but doesn't change the scale, how?
more or less the desired look like this
the picture was obtained when I scroll on the page
Related
Is it possible to use CSS to reproduce the shadow under the device of the below image?
The following CSS and different variants don't work:
filter: drop-shadow(rgba(22, 22, 22, 0.25) 0px 12px 15px);
The problem is concentrating the shadow under the device and flattening it. The CSS above cannot make the shadow appear as if it's projected on the ground.
Codepen: https://codepen.io/Crashalot/pen/MWYzoJV
A pseudo element is better suited to get this done, see below example:
.object {
margin: 20px;
width: 70px;
height: 140px;
position: relative;
border-style: solid;
background: #E6E6FA;
}
.object:before {
content:"";
z-index: -1;
position: absolute;
bottom: -50%;
width: inherit;
height: inherit;
border-radius: 40%;
background: rgba(0,0,0,.55);
transform: scaleX(1.3) scaleY(0.12);
filter: blur(5px);
}
<div class="object"></div>
Alternatively, you can use box-shadow:
.object {
margin: 20px;
width: 70px;
height: 140px;
position: relative;
border-style: solid;
background: #E6E6FA;
/* This is .shadow-lg from tailwindCSS */
/* See https://tailwindcss.com/docs/box-shadow/ */
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
<div class="object"></div>
My goal is to position a CSS pseudo arrow below it's parent popup menu.
Setting z-index on the pseudo element to -1 works...that is, if I haven't set a z-index on the parent.
The issue is that it's a popup, it the parent must have a z-index set.
How can I set a z-index for the parent, and have the pseudo appear below?
.dropdown-menu {
top: calc(100% + 5px);
display: block;
position: absolute;
background-color: white;
padding: 5px;
border: 1px solid rgba(0, 0, 0, .15);
box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
z-index: 9999;
min-width: 150px;
}
.dropdown-menu::before {
background-color: #706f6f;
content: '';
display: block;
position: absolute;
left: 50%;
height: 10px;
width: 10px;
transform: translate(-50%, 0) rotate(45deg);
box-shadow: 7px 7px 11px 0px rgba(112, 111, 111, 0.3);
margin-top: -5px;
top: 100%;
z-index: -1;
}
I'm trying to replicate the white box on this page, Where it says "your success".
body{
background-color:#DFDFDF;
}
.index_whitebox{
background-color: #fff;
height: 60%;
width: 25%;
position: absolute;
margin-left: 4%;
margin-bottom: 20px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 10px;
}
<div class="index_whitebox">
</div>
I assume there's no border-style and I use % for mobile compatibility. I can't seem to get the border right.
If you look in 'inspect element' you can actually see how they've coded it. I bunched together the main bits they use, as some used a CSS file and others were inline.
.class1 {
left: 1px;
width: 302px;
position: absolute;
top: 445px;
height: 378px;
}
.class2 {
left: 1px;
width: 302px;
position: absolute;
top: 445px;
height: 378px;
}
.class3{
border: 2px solid rgba(255, 255, 255, 1);
background-color: rgba(255, 255, 255, 1);
border-radius: 5px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
It's all in here:
Here's a JsFiddle.
I have an transformed image and I would like to add a gradient (black to transparant) on it.
HTML :
<div class="contentwrap">
<div class="perspectiveDiv">
<img src="http://image.noelshack.com/fichiers/2014/34/1408372755-black-card.png" class="img" />
</div>
</div>
CSS :
.contentwrap {
margin: 0 auto;
max-width: 600px;
height: 100%;
display: table;
padding-top: 150px;
}
.perspectiveDiv{
perspective:750px;
position: relative;
left: 0;
top: 0;
}
.img{
position: absolute;
top: -152px;
left: 25px;
transform: rotateX(60deg);
max-width: 250px;
-webkit-box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.8);;
-moz-box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.8);;
box-shadow: 0 60px 45px -20px rgba(0, 0, 0, 0.8);;
-moz-border-radius: 15px;
border-radius: 16px;
background: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}
Here is the kind of result that I need (made with photoshop) :
I found how to apply a gradient on a background image, but not a standard image...
Is it possible to do what I need ?
Can you help me to do it ? It could be very simple but I'm a beginner and I didn't manage to do it...
I have this piece of html:
<html>
<body>
<header></header>
<div></div>
<footer></footer>
</body>
</html>
and this piece of css:
header {
width: 500px;
height: 100px;
background: red;
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5);
z-index: 10;
}
div {
width: 500px;
height: 700px;
background: yellow;
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5);
z-index: 5;
}
footer {
width: 500px;
height: 50px;
background: blue;
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5);
z-index: 10;
}
You can see this also here: http://jsfiddle.net/XGTtT/ Basically, I would like to have yellow area below other two areas, but z-index doesn't seem to work. What is wrong and how to fix it?
To achieve elements which are positioned in front or below each other you will need to use a mix of absolute positioning and z-index, as z-index will not currently work with the default positioning, which is static.
Depending on what you want to achieve it may be easier to add position: relative to the divs, and then use a negative margin on the div to pull it up/below the header and footer.
header {
width: 500px;
height: 100px;
background: red;
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5);
z-index: 10;
position: absolute;
top:0;
}
div {
width: 500px;
height: 450px;
background: yellow;
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5);
z-index: 5;
position: absolute;
}
footer {
width: 500px;
height: 50px;
background: blue;
box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5);
z-index: 10;
position: absolute;
bottom: 0;
}
http://jsfiddle.net/XGTtT/8/
Higher number will come front, lower number will go back. A
nd give some different number for each element. Like for div 1, for header 2 and for footer 3.