the text fade should appear with solid text on the left and faded text on the right. in this example i made how would you fade jupiter to look like earth and mars using only css?
.hello-jupiter {
display:inline-block;
background: rgba(215, 215, 215, 1);
color:white;
box-shadow: inset 0px 10px 15px -10px rgba(50, 50, 50, .5), inset 0px -10px 25px -10px rgba(50, 50, 50, .75);
}
jsfiddle <-- actually uses box-shaodw and not a gradient
I find this website is handy for CSS...
http://www.css3maker.com/css-gradient.html
CSS generated from the css3maker website:
.hello-jupiter {
display:inline-block;
background: rgba(215, 215, 215, 1);
color:white;
background:-webkit-gradient(linear, 100% 0%, 37% 0%, from(#FFFFFF), to(#000000))
}
This will only work in Chrome and Safari versions 4.0+
Here is an answer. I just floated a div to the right faded it from 0 to 100% opacity.
.hello-jupiter {
display:inline-block;
background: rgba(215, 215, 215, 1);
color:white;
box-shadow: inset 0px 10px 15px -10px rgba(50, 50, 50, .5), inset 0px -10px 25px -10px rgba(50, 50, 50, .75);
position:relative;
}
.fader {
position:absolute;
top:0px;
right:0px;
display:block;
width:75px;
background: -webkit-linear-gradient(left,rgba(255, 255, 255, 0) 0%,rgba(255, 255, 255, 1) 75%)
}
http://jsfiddle.net/w92xv/45/
Related
I want something like this but, unfortunately not able to get this shaddow effect any help would be great
.circle{
width:50px;
height:50px;
border-radius:50%;
background-color :yellow;
display:flex;
align-items:center;
justify-content:center;
}
.inner_img{
}
I want something like this:
here is the attach fiddle file http://jsfiddle.net/3u0mxjqq/188/
I tried to replicate the same effect using text-shadow: rgb(39, 118, 152) -1px 1px. Check this fiddle
.inner_img {
color: white;
font-size: 22px;
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
.icon {
width: 50px;
height: 50px;
border-radius: 50%;
background-color: rgb(59, 175, 228);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
text-shadow: rgb(39, 118, 152) -1px 1px, rgb(39, 118, 152) -2px 2px, rgb(39, 118, 152) -3px 3px, rgb(39, 118, 152) -4px 4px, rgb(39, 118, 152) -5px 5px, rgb(39, 118, 152) -6px 6px, rgb(39, 118, 152) -7px 7px, rgb(39, 118, 152) -8px 8px, rgb(39, 118, 152) -9px 9px, rgb(39, 118, 152) -10px 10px, rgb(39, 118, 152) -11px 11px, rgb(39, 118, 152) -12px 12px, rgb(39, 118, 152) -13px 13px, rgb(39, 118, 152) -14px 14px, rgb(39, 118, 152) -15px 15px, rgb(39, 118, 152) -16px 16px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" />
<div class="container">
<div class="icon">
<div class="inner_img">
<i class="fa fa-search"></i>
</div>
</div>
</div>
It's not possible using box-shadow rule alongside font-awesome glyphs.
You can achieve that effect using multiple text-shadow instances.
Solution (CSS3 only / working IE10+)
.circle{
width:50px;
height:50px;
border-radius:50%;
background-color :yellow;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
}
.fa-search{
text-shadow:rgb(148, 148, 0) 1px 1px, rgb(148, 148, 0) 2px 2px, rgb(148, 148, 0) 3px 3px, rgb(148, 148, 0) 4px 4px, rgb(148, 148, 0) 5px 5px, rgb(148, 148, 0) 6px 6px, rgb(148, 148, 0) 7px 7px, rgb(148, 148, 0) 8px 8px, rgb(148, 148, 0) 9px 9px, rgb(148, 148, 0) 10px 10px, rgb(148, 148, 0) 11px 11px, rgb(148, 148, 0) 12px 12px, rgb(148, 148, 0) 13px 13px, rgb(148, 148, 0) 14px 14px, rgb(148, 148, 0) 15px 15px, rgb(148, 148, 0) 16px 16px, rgb(148, 148, 0) 17px 17px, rgb(148, 148, 0) 18px 18px, rgb(148, 148, 0) 19px 19px, rgb(148, 148, 0) 20px 20px, rgb(148, 148, 0) 21px 21px, rgb(148, 148, 0) 22px 22px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="circle">
<i class="fa fa-search"></i>
</div>
One way would be to make a div and position it exactly in the correct spot as if it were a shadow of your choice. That along with the proper z-index would make it possible to position it correctly under the image in the middle but on top of the circle. Hope this helped. If you want to make the circle glow see: http://cssdeck.com/labs/glowing-circle
Also, if an image is included in the middle of the circle, the box-shadow could also work to provide a shadow of any color outside in any direction of the image.
I am trying to accomplish the left widget box below and as you can see, there is a diagonal linear gradient, as well as a shine from top to bottom. The one I created in CSS is to the right, while the one I am trying to accomplish is to the left. Is there a way I can accomplish this using only one background property? Or would I need to surround the entire div with another div so I can overlay a semi-transparent gradient on it? Thanks
UPDATED with code:
.drk-grad {
background: linear-gradient(to bottom, #d2d2d2 7%, #b1b1b1 100%);
-webkit-border-radius: 10px;
border-radius: 10px;
background-clip: padding-box;
-webkit-box-shadow: 0px 1px 3px 1px #969494;
box-shadow: 0px 1px 3px 1px #969494;
border-top: 1px solid rgba(255, 255, 255, 0.7);
border-left: 1px solid rgba(255, 255, 255, 0.3);
}
SOLUTION:
background: repeating-linear-gradient(rgba(255,255,255,.5) -1%, rgba(107, 107, 107, 0.1), repeating-linear-gradient(135deg, #b6b6b6, #B6B6B6 10px, #b2b2b2 10px, #b2b2b2 20px);
Generally you can add multiple backgrounds, separated by commas. The first one listed will appear on top.
http://css-tricks.com/stacking-order-of-multiple-backgrounds/
http://lea.verou.me/css3patterns/
Here's a basic outline. Play with the numbers for your exactly desired effect:
div {
background:
linear-gradient(to top, transparent, #b1b1b1 100%),
gray repeating-linear-gradient(45deg, transparent, transparent 35px,
rgba(255, 255, 255, 0.5) 35px,
rgba(255, 255, 255, 0.5) 70px);
background-clip: padding-box;
border-left: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 10px;
border-top: 1px solid rgba(255, 255, 255, 0.7);
box-shadow: 0px 1px 3px 1px #969494;
height: 250px;
width: 250px;
}
Demo: https://jsbin.com/fidaxigaxi/edit?html,css,output
I have the following Box Shadow css style. Unfortunately it is covering a very small portion on the top of the mainContent DIV. The rest of the DIV length is without any shadow. What am I doing wrong?
.mainContent {width: 85%; margin: auto; max-width:1400px;
-webkit-box-shadow: 0px 9px 26px 5px rgba(50, 50, 50, 0.75);
-moz-box-shadow: 0px 9px 26px 5px rgba(50, 50, 50, 0.75);
box-shadow: 0px 9px 26px 5px rgba(50, 50, 50, 0.75);}
You should set the height property to auto.
jsfiddle
.mainContent {width: 85%; margin: auto; max-width:1400px;
-webkit-box-shadow: 0px 9px 26px 5px rgba(50, 50, 50, 0.75);
-moz-box-shadow: 0px 9px 26px 5px rgba(50, 50, 50, 0.75);
box-shadow: 0px 9px 26px 5px rgba(50, 50, 50, 0.75);
height:auto
}
<div class='mainContent'>
<div style='height:50px; width:50px; border:1px solid'></div>
</div>
Fiddle link I want two div with 100% height.
1 div with background image and one color.
both should equally in height in any resolution.
please help me.
.loginImage { width: 100%; }
.loginBox {
background-color: #ffffff;
background: rgba(255, 255, 255, 0.2);
-webkit-box-shadow: 1px 0px 9px 0px rgba(50, 50, 50, 0.55);
-moz-box-shadow: 1px 0px 9px 0px rgba(50, 50, 50, 0.55);
box-shadow: 1px 0px 9px 0px rgba(50, 50, 50, 0.55);
height: 100%;
position: absolute;
}
<div class="wrapper-login">
<div class="col-xs-6"><img src="images/loginImage.jpg" alt="Cargo CRM" class="loginImage"></div>
<div class="col-xs-3 loginBox"></div>
</div>
Fiddle
.col-xs-6 {
width: 47.66666667%;
display:table-cell;
text-align:left;
}
.col-xs-3 {
width: 25%;
display:table-cell;
text-align:left;
}
.loginImage {
width: 100%;
}
.loginBox {
background-color: #ffffff;
background: rgba(255, 255, 255, 0.2);
-webkit-box-shadow: 1px 0px 9px 0px rgba(50, 50, 50, 0.55);
-moz-box-shadow: 1px 0px 9px 0px rgba(50, 50, 50, 0.55);
box-shadow: 1px 0px 9px 0px rgba(50, 50, 50, 0.55);
}
.wrapper-login {
margin: 0 auto;
width: 100%;
display:table;
}
Is it what you are looking for?
Basically the below code should simply be a white page with a shadow around the edge. This works fine in Chrome but I can't seem to get it to work in Firefox!
<html>
<head>
<style type=text/css>
body {
background:#ffffff;
font-family:arial;
margin:auto;
box-shadow:inset 0px 0px 100px #333333;
-moz-box-shadow:inset 0px 0px 100px #333333;
-webkit-box-shadow:inset 0px 0px 100px #333333;
}
</style>
</head>
<body>
</body>
</html>
View the page here:
http://pastehtml.com/view/bagevr6ke.html
Look at it in Chrome then Firefox, and tell me if you see a difference : )
Cheers
EDIT: So the post below explained how to fix the above code, a CSS reset worked and also i learned about quirk mode and doctypes :)
However the CSS page i am working on is still suffering from this bug no matter what reset i use. I am not currently using a Doctype as i am not sure what i should put, or whether it would fix the bug.
Here is the complete site:
http://middle.dyndns-server.com/results.html
And the stylesheet:
body {
background:url('bg.png');
font-family:arial;
margin:auto;
box-shadow:inset 0px 0px 100px #333333;
-moz-box-shadow: inset 0px 0px 100px #333333;
-webkit-box-shadow:inset 0px 0px 100px #333333;
}
#footer {
padding-bottom:10px;
margin-top:30px;
}
#page {
width:960px;
height:auto;
background-color:#ffffff;
#background:url('bg2.png');
/*Space*/
padding-top:0px;
padding-bottom:0px;
padding-left:0px;
padding-right:0px;
margin-top:-10px;
margin-bottom:0px;
margin-left:auto;
margin-right:auto;
/*Shadow*/
-moz-box-shadow: 0px 0px 100px 0px #999999,inset 0 0 10px #000000;
-webkit-box-shadow: 0px 0px 100px 0px #999999,inset 0 0 10px #000000;
box-shadow: 0px 0px 100px 0px #999999,inset 0 0 10px #000000;
/*Border Radius*/
border-radius:0px 0px 20px 20px;
-moz-border-radius:0px 0px 20px 20px;
-webkit-border-radius:0px 0px 20px 20px;
-o-border-radius:0px 0px 20px 20px;
}
input[type=text] {
background: -webkit-gradient(linear,left top,right bottom,from(#333333),to(#666666));
background: -moz-linear-gradient(top, #333333, #666666);
filter: filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#666666');
border-width:1px;
border-style:solid;
border-color:#777777;
color:ffffff;
}
.line1 {
float:left;
align:center;
padding-bottom:0px;
}
hr {
clear:left;
color:#111111;
}
/* The *normal* state styling */
.btn{
background-image:linear-gradient(90deg, rgba(51, 51, 51, 0.8), rgba(0, 0, 0, 0.2));
background-image:-webkit-gradient(linear, 0% bottom, 0% top,color-stop(0%, rgba(51, 51, 51, 0.8)), color-stop(100%, rgba(0, 0, 0, 0.2)));
background-image:-moz-linear-gradient(90deg, rgba(51, 51, 51, 0.8), rgba(0, 0, 0, 0.2));
filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#80333333', EndColorStr='#20000000');
-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#80333333', EndColorStr='#20000000')";
background-color:rgb(51, 51, 51);
border:1px solid rgb(0, 0, 0);
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
padding:5px 10px;
box-shadow:0px 0px 6px rgb(130, 130, 130);
-moz-box-shadow:0px 0px 6px rgb(130, 130, 130);
-webkit-box-shadow:0px 0px 6px rgb(130, 130, 130);
font-size:12px;
font-weight:normal;
color:rgb(255, 255, 255);
text-shadow:0px 0px 1px rgb(255, 255, 255);
}
/* The *hover* state styling */
.btn:hover{
background-image:linear-gradient(-90deg, rgba(51, 51, 51, 0.8), rgba(0, 0, 0, 0.2));
background-image:-webkit-gradient(linear, left top, left bottom,color-stop(0%, rgba(51, 51, 51, 0.8)), color-stop(100%, rgba(0, 0, 0, 0.2)));
background-image:-moz-linear-gradient(-90deg, rgba(51, 51, 51, 0.8), rgba(0, 0, 0, 0.2));
box-shadow:0px 0px 6px rgb(0, 0, 0);
-moz-box-shadow:0px 0px 6px rgb(0, 0, 0);
-webkit-box-shadow:0px 0px 6px rgb(0, 0, 0);
}
/* The *active* state styling */
.btn:active,.btn:focus{
background-image:linear-gradient(90deg, rgba(51, 51, 51, 0.8), rgba(0, 0, 0, 0.2));
background-image:-webkit-gradient(linear, 0% bottom, 0% top,color-stop(0%, rgba(51, 51, 51, 0.8)), color-stop(100%, rgba(0, 0, 0, 0.2)));
background-image:-moz-linear-gradient(90deg, rgba(51, 51, 51, 0.8), rgba(0, 0, 0, 0.2));
}
a {
font-family:arial;
outline:none;
text-decoration:none;
color:333333;
}
a:link {
text-decoration:none;
}
a:visited {
text-decoration:none;
}
a:active {
text-decoration:none;
color:ffffff;
}
a:hover {
text-decoration:none;
}
I am sure its not all great but i am learning and this issue is my main focus right now : )
Thanks a lot.
Add this:
html, body {
height: 100%
}
http://jsbin.com/oyuzug
There is nothing in body, so it has no height.
The only reason it worked without this in Chrome is because you did not include a doctype as the very first line to enable Standards Mode.
Test these in Chrome:
Your original code: http://jsbin.com/urimah
Your original code with doctype: http://jsbin.com/urimah/2
Conclusion: Always include a doctype as the very first line to avoid Quirks Mode and the inconsistencies it brings between different browsers.
Firefox shows you the right thing because right now body has no height. So you have to define the height of your body.
Write this in your CSS:
html, body {
height: 100%
}
So the answer marked as correct CSS - Mozilla bug? box-shadow:inset not working properly does not work for me. Why? Because the example includes no content. When you style the <body> and <html> elements with height: 100% it creates a strange bug where the 100% is technically registering as 100% of the viewport rather than 100% of the window height.
This is a great example of how to do this properly: http://www.dave-woods.co.uk/wp-content/uploads/2008/01/full-height-updated.html. Styling the body and html elements at height: 100% is correct, however, your inner-shadow needs to be attached to another element (can't be body or html) and then min-height: 100% as well as box-shadow: 0 0 100px #000 attached to the shim, e.g.
html, body { height: 100% }
#styled-div {
min-height: 100%;
box-shadow: 0 0 100px #000;
}