by default, Blogger's Simple Template comes with a box/shadow around images. You can see them around images in any Blogger blog that hasn't edit it, like this one:
http://conalmadefiesta.blogspot.com.es/
I found a code to completely remove it:
.post-body img, .post-body .tr-caption-container, .Profile img, .Image img,
.BlogList .item-thumbnail img {
padding: none !important;
border: none !important;
background: none !important;
-moz-box-shadow: 0px 0px 0px transparent !important;
-webkit-box-shadow: 0px 0px 0px transparent !important;
box-shadow: 0px 0px 0px transparent !important;
}
And also I have found a code to remove it only in some images. Adding the class noborder on the html of every post with an image, and this in the css:
img.noborder {
border: 0px;
-moz-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
-webkit-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
border-radius: 0px 0px 0px 0px;
background: none;
}
I want to do JUST the opposite: find a code that doesn't show the shadow by default but that it does when I try add a class (let's say: border) to the image.
Any ideas on how can I do this?
Thanks!
You got it yet! You've got the code to remove the shadows, so thinking a little you can make the opposite (I'm using :not() pseudoselector in CSS):
/* remove all boxshadows except tags with "border" classname */
.post-body img:not(.border), .post-body .tr-caption-container:not(.border), .Profile img:not(.border), .Image img:not(.border),
.BlogList .item-thumbnail img:not(.border) {
padding: none !important;
border: none !important;
background: none !important;
-moz-box-shadow: 0px 0px 0px transparent !important;
-webkit-box-shadow: 0px 0px 0px transparent !important;
box-shadow: 0px 0px 0px transparent !important;
}
So if you need to put a box shadow in some img you can add border class:
<img src="img.png" class="border">
It works!
See more information about :not() selector:
https://developer.mozilla.org/es/docs/Web/CSS/%3Anot
you should like this -
.post-body img.noborder , .Profile img.noborder , .Image img.noborder , .BlogList .item-thumbnail img.noborder {
border: 0px;
-moz-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
-webkit-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
border-radius: 0px 0px 0px 0px;
background: none;
}
or you can use !important-
img.noborder {
-moz-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0) !important;
-webkit-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0) !important;
box-shadow: 0px 0px 0px rgba(0, 0, 0, .0) !important;
}
Maybe you just need to create an other class called .border with:
.border {
border: 1px solid #eeeeee;
-moz-box-shadow: 1px 1px 5px rgba(0, 0, 0, .1);
-webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, .1);
box-shadow: 1px 1px 5px rgba(0, 0, 0, .1);
}
And then add this class to images that you want with shadows.
In this case, you should ignore this:
img.noborder {
border: 0px;
-moz-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
-webkit-box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
box-shadow: 0px 0px 0px rgba(0, 0, 0, .0);
border-radius: 0px 0px 0px 0px;
background: none;
}
And leave:
.post-body img, .post-body .tr-caption-container, .Profile img, .Image img,
.BlogList .item-thumbnail img {
padding: none !important;
border: none !important;
background: none !important;
-moz-box-shadow: 0px 0px 0px transparent !important;
-webkit-box-shadow: 0px 0px 0px transparent !important;
box-shadow: 0px 0px 0px transparent !important;
}
Here, the images will not have shadows except for those with .border
Related
how might I add a shadow effect on a background image, using CSS ? I would like to have a shadow on the left, right and bottom of the background image ?
The command to add the shadow is the "box-shadow". But you can use this site to do this automatically for you:
https://www.cssmatic.com/box-shadow
There's a really handy tool that may help you here https://cssgenerator.org/box-shadow-css-generator.html.
This is an example of a shadow that appears in the areas you mentioned
box-shadow: 0px 6px 10px 0px rgba(0, 0, 0, 0.57);
I've made an example for you:
.shadow {
width: 90%;
margin: 20px;
height: 100px;
background: url(https://placekitten.com/640/360);
box-shadow: 0px 6px 10px 0px rgba(0, 0, 0, 0.57);
-webkit-box-shadow: 0px 6px 10px 0px rgba(0, 0, 0, 0.57);
-moz-box-shadow: 0px 6px 10px 0px rgba(0, 0, 0, 0.57);
}
<div class="shadow"></div>
div {
width: 300px;
height: 300px;
box-shadow: 0 15px 30px #888 inset
}
<div>
</div>
Refer inset property of box-shadow: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow#Values
In an attempt to create shadows around custom shapes, I discovered the drop-shadow filter CSS property. However after having implemented it, I realised that it slowed the website down significantly.
I am therefore searching for an alternative to gain the same effect without compromising the load speed of the page.
The main content of the site is surrounded by a shadow-box wrapper using a box shadow, but this could not be used for the end section due to the transparent part of the background.
I am trying to achieve a shadow which resembles the shadow of the shadow-box.
Here is a jsFiddle illustrating how it currently looks
and here it can bee seen on the real site
HTML
<div class="container shadow-box no-padding"></div>
<div class="container justify-content-center">
<section class="light-bg end-section" id="portfolio"></section>
</div>
CSS
.container{
width:70%;
margin:auto;
}
.shadow-box{
background:green;
height:200px;
-webkit-box-shadow: 0px 0px 21px 8px rgba(0, 0, 0, 0.6) !important;
-moz-box-shadow: 0px 0px 21px 8px rgba(0, 0, 0, 0.6) !important;
-ms-box-shadow: 0px 0px 21px 8px rgba(0, 0, 0, 0.6) !important;
-o-box-shadow: 0px 0px 21px 8px rgba(0, 0, 0, 0.6) !important;
box-shadow: 0px 0px 21px 8px rgba(0, 0, 0, 0.6) !important;
}
.end-section {
background: radial-gradient(circle at 50% 100%, transparent 50px, #c1c1c1 50px);
z-index: 5;
height:200px;
filter: drop-shadow(0 30px 15px rgba(0, 0, 0, 0.6))
drop-shadow(0 10px 5px rgba(0, 0, 0, 0.6));
}
.light-bg:before {
content: '';
position: absolute;
z-index: 3;
top: -50px;
left: 50%;
margin-left: -50px;
height: 50px;
width: 100px;
border-top-left-radius: 100px;
border-top-right-radius: 100px;
background: #c1c1c1;
}
Here's the screenshot of my issue: http://i.imgur.com/oXkLNeY.png, as you can see here, the quote doesn't align to the top of the website, and I don't know why it happens. Any solutions? Here's the code:
<body>
<div id="container">
<div id="header"> <img src="media/images/logo.png"> </div>
<div style="background: #000; width: 440px; height: 344px; -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); text-align: justify; display: inline-block;"> <img src="media/images/covers/comingsoon.png"></div> <!-- YOUTUBE -->
<div style="background: #000; width: 410px; height: 125px; -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); text-align: justify; display: inline-block;"><h1 style="margin: 10px;">"The sky above the port was the color of television, tuned to a dead channel."</h1></div> <!-- QUOTE -->
<div style="background: #000; width: 405px; height: 125px; -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); display: inline-block;"> <img width="400px" src="media/images/covers/breathless.png"> </div> <!-- BREATHLESS -->
<div style="background: #000; width: 405px; height: 125px; -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); display: inline-block;"> <img width="400px" src="media/images/covers/breathless.png"> </div> <!-- BREATHLESS -->
<div style="background: #000 url(http://38.media.tumblr.com/c24cbbf9efaed9992839b7feca83f9be/tumblr_nlzqeuNbDp1slaspwo2_500.gif); width: 860px; height: 212px; text-align: center; -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.95); margin: 0px auto;"><img src="media/images/covers/secret.png"></div> <!-- SECRET_SOCIETY -->
</div>
</body>
I want the quote to be right next to comingsoon.png box, and then the rest of images below.
It's likely that the browser's default margin or padding, usually around 16px, has not been overwritten.
Try adding the below to your CSS:
html,body {
margin: 0;
padding: 0;
}
I would like to ask how should I apply different colour glow to an image border when a user hover over? like say that in this JSFiddle file, I have a green thumb and a red thumb. I want each image border to glow according to the colour of the image, or any colour that I specify. How should I achieve that?
PS** For example purposes the image are converted to base64 in the JSFiddle.
This is how I do in my CSS
img{
width: 16px;
cursor: pointer;
padding: 10px;
}
img:hover{
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 5px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 5px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
Thank You
If I understand your question then here is an example DEMO
img{
width: 48px;
cursor: pointer;
/*padding: 10px;*/
/* border:1px solid #fff;*/
margin-right: 20px;
}
img:hover{
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0px 0px 30px 0px rgba(0, 255, 0, 0.67);
-moz-box-shadow: 0px 0px 30px 0px rgba(0, 255, 0, 0.67);
box-shadow: 0px 0px 30px 0px rgba(0, 255, 0, 0.67);
}
img:last-of-type:hover{
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0px 0px 30px 0px rgba(232, 0, 0, 0.67);
-moz-box-shadow: 0px 0px 30px 0px rgba(232, 0, 0, 0.67);
box-shadow: 0px 0px 30px 0px rgba(232, 0, 0, 0.67);
}
As written in the comment, there is no way for HTML/CSS to determine the main color of the image displayed. If you know the predominant color of each image, give them class names accordingly and write the related CSS.
See demo for a simple version.
img.green:hover{
border-color: #66afe9;
box-shadow: 0 0 8px rgba(0,255,0, 0.6);
}
img.red:hover{
border-color: #66afe9;
box-shadow: 0 0 8px rgba(255,0,0, 0.6);
}
Change:
box-shadow: inset 5px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
to:
box-shadow: inset 0 0 5px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
DEMO
box-shadow Syntax:
Formal syntax: none | [inset? && [ <offset-x> <offset-y> <blur-radius>? <spread-radius>? <color>? ] ]#
Box shadow also worked for,
img:hover{ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); }
If you want to more style in css
http://ianlunn.github.io/Hover/
or use your custom image like this
img:hover{background:url('http://www.addglitter.com/link-sparkle.gif');
I am developing this website.
The problem I am facing is white space on right side of header on zoom in. I did all sorts of things but failed to fill the white with area of header part with black.
Relevant CSS code: (I am not pasting the whole code as it is too lengthy, you can find it in the website)
header
{
float:left;
width:100%;
height:700px;
background:#000000;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
-moz-box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
}
.header_main
{
background: #000000;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
-moz-box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
float:left;
height:800px;
width:100%;
}
There are lot of issues , follow as suggested below:
1 .slideshow{margin: -10px 0 0 50px;} Remove this line from the class .slideshow
2 .headrouter{ padding-left:100px; width:1200px;} Remove padding-left and set width:1100px
3 #site_content {margin-left:50px; } remove margin-left
4 Add overflow-x:hidden to body like below:
body {
background: none repeat scroll 0 0 #FFFFFF;
font: 80% Arial,Helvetica,sans-serif;
overflow-x: hidden;
}
That should resolve the issue.
It is because on your http://www.brilliantseotechnologies.com/css/2nav.css you have width:98% for your ul.menu class