Disable border or hover effect on selected images only - html

I have the following code to create a border around all images as well as hover effects, but how do I disable this on selected images (ie. social buttons or logo)
img {
padding: 5px;
border: solid 1px #EFEFEF;
}
a:hover img {
border: solid 1px #CCC;
-moz-box-shadow: 1px 1px 5px #999;
-webkit-box-shadow: 1px 1px 5px #999;
box-shadow: 1px 1px 5px #999;
}

you could add a class to the image that you want/dont want to have the borders, then style them differently by using their class in the css instead.

You should write in css the full path to the image,for example
div.hover-img ul li p a:hover img {
border: solid 1px #CCC;
-moz-box-shadow: 1px 1px 5px #999;
-webkit-box-shadow: 1px 1px 5px #999;
box-shadow: 1px 1px 5px #999; }
This additional class .hover-img and the path to the image helps you identify only the images you need to be bordered in hover position.

add a seperate class
.noshadow{ border:none; box-shadow:none}
Add this class to the element where you don't required the box-shadow and border

use the css not selector
like this
html markup
<div>
<img src="http://images03.olx.in/ui/3/20/99/45761199_1.jpg" alt="not found"/>
<img src="http://i1-news.softpedia-static.com/images/news2/Facebook-Changes-Font-Size-Users-Grab-Their-Pitchforks-2.jpg" alt="not found" class="noborder"/>
</div>
css
img:not(.noborder) {
border: 2px solid red;
}
see the Documentation and use here
Demo Fiddle

Related

CSS border style inside

I want to create a border as shown in the image. I tried with all the styles inset, outset,ridge and groove but I was not able to get the expected result.
Is there any way to bend border towards inside till middle and get back towards till top(hope you understand the problem).
If it's repeated question please add the solution link.
Thanks in advance.
I have tried this:
div {
border-bottom: 1px ridge #B5B9BB;
/*border-bottom: 1px inset #B5B9BB;
border-bottom: 1px outset #B5B9BB;
border-bottom: 1px groove #B5B9BB; */
}
You could use outline:
.bordered {
border-bottom: 1px solid grey;
background: aliceblue;
outline: 5px solid aliceblue;
}
<div class="bordered">Available Apps</div>
Demo
Seems why not just use a border on the text?
div {
background: lightgrey;
padding: 0.5em;
}
p {
border-bottom: 1px ridge #B5B9BB;
}
<div>
<p>Available Apps</p>
</div>
It is probably best to use a wrapping element if possible; it is more flexible than outline (supports border-radius, box-shadows etc.)
For example:
<div class="headline-area">
<h2>Available Apps</h2>
</div>
with the CSS:
.headline-area {
background:#D4D9DC;
padding:5px;
}
.headline-area h2 {
border-bottom:1px solid #B5B9BB;
}
Whenever I am in your situation I use box-shadow:
body {
background:#D1D6D9;
font-family:verdana;
}
div {
border-bottom: 1px solid #B5B9BB;
box-shadow:0 1px 1px rgba(255,255,255,.7);
padding-bottom:5px;
}
<div>Available Apps</div>
You could always try a hr tag. You can then style it in CSS to your desired preference.
HTML
New apps
<hr>
Try this Also but you need an extra Div to do so.
HTML
<div class="outerDiv">
COntent
<div class="innerDiV">
</div>
<div>
CSS
.outerDiv{
background-color: grey;
height: 32px;
text-align: center;
padding: 16px;
font-weight: bolder;
font-size: 25px;
}
.innerDiV{
margin: 0 auto;
border: 1px solid black;
width: 98%;
margin-top: 10px;
}
Demo

I am trying to give "box-shadow" to my image but i doesn't works

Can u tell me what is wrong with my code?Why there is no shadow on image?
Here is my code:
HTML
<div class="wrapper">
<img src="http://i.imgur.com/aVt9qPi.png"/>
</div>
CSS
div.wrapper img{
-moz-box-shadow:inset 1px 2px 18px #000000;
-webkit-box-shadow:inset 1px 2px 18px #000000;
box-shadow:inset 1px 2px 18px #000000;
}
U can find working demo here
you cannot apply shadow inset effect directly on image. Better apply it on the div.
Check the DEMO.
div.wrapper{
-moz-box-shadow:inset 1px 2px 18px #000000;
-webkit-box-shadow:inset 1px 2px 18px #000000;
box-shadow:inset 1px 2px 18px #000000;
}
div.wrapper img{
position:relative;
z-index:-1;
}
Inset shadows do not work on image tags, but you can wrap your img in a parent element to achieve the same effect.
See this solution for an example.

Inset shadow over an image in CSS

I'm trying to create an overlay shadow over an image in CSS but I can't seem to get it right.
Here's the code that I have so far.
http://jsfiddle.net/Qf4Ka/1/
HTML
<section id="top-container" class="top-column" style="width:1050px; height:420px; ">
<div class="image" style="padding-top: 10px; float:left;"><img src="http://www.hdwallpapersinn.com/wp-content/uploads/2012/09/HD-Wallpaper-1920x1080.jpg" border="0"; width="263"; height="200" style="display: block; border-top: 1px solid #dddddd; border-bottom: 1px solid #dddddd; border-right: 1px solid #dddddd;">
<h4 style="font-size:30px; top: 90px; ">Nature</h4></div>
<div class="image" style="padding-top: 10px; float:left;"><img src="http://www.hdwallpapersart.com/wp-content/uploads/2013/04/tiger_wallpapers_hd_Bengal_Tiger_hd_wallpaper1.jpg" border="0"; width="262"; height="200" style="display: block; border-top: 1px solid #dddddd; border-bottom: 1px solid #dddddd; ">
<h4 style="font-size:30px; top: 90px; ">Bengal Tiger</h4></div>
</section>
CSS
.image {
position: relative;
}
h4 {
position: absolute;
width: 100%;
color: #fff;
float: left;
position: absolute;
font-size: 40px;
font-family: "Oswald";
text-align: center;
max-height:auto;
z-index:20;
text-shadow:1px 1px 2px #000;
-moz-text-shadow:1px 1px 2px #000;
-ms-text-shadow:1px 1px 2px #000;
-o-text-shadow:1px 1px 2px #000;
-webkit-text-shadow:1px 1px 2px #000;
}
I basically want it to look like the one in this website. I tried looking at some tutorials online but it screwed it up real bad so I removed it. I want it to look like the one in this website before and after I hover around the image. Thanks so much to anybody who can help me.
http://vr-zone.com/
Like this
demo
css
.image {
position: relative;
-webkit-box-shadow: inset 0 0 10px 10px #000;
-moz-box-shadow: inset 0 0 10px 10px #000;
box-shadow: inset 0 0 10px 10px #000;
}
OR REF LINK
Your text shadow effect actually seems to work fine, just a few syntactical errors within the html, and need to import the font. Also you don't need to vendor prefix the text-shadow rule.
Check this DEMO.
Edit: I agree with the comment above - Yes, if you are trying to give box-shadow to the image, then use box-shadow.

span not working on Bootstrap button

I have a bootstrap button over which I want to have a bubble with a number, much like a notification that appears on an app icon in an iphone.
My mark up for the button is:
<button class="btn btn-warning view-sl-btn" type="button"><span class="notification, red">6</span>View Shortlist</button>
And the Css for the span is:
.btn.span {
position: absolute;
background-color: #f56c7e;
border: 1px solid #ce4f5e;
padding: 2px 5px 1px;
margin-left: -2px;
margin-top: -16px;
border-radius: 100px;
color: #fff;
text-shadow: 0px 1px 0px rgba(0,0,0,0.2);
font-size: 11px;
-webkit-box-shadow: inset 0px 1px 2px rgba(255,255,255,0.4);
-moz-box-shadow: inset 0px 1px 2px rgba(255,255,255,0.4);
-o-box-shadow: inset 0px 1px 2px rgba(255,255,255,0.4);
box-shadow: inset 0px 1px 2px rgba(255,255,255,0.4);
}
.btn.span.red {
background-color: #f56c7e;
border-color: #ce4f5e;
}
But it doesn't seem to work.
Any advice will be much appreciated.
Cheers
The issue is with your CSS declaration:
.btn.span
(Would apply styles to all elements with the 'btn' class AND the 'span' class.)
<div class="btn span" />
You want this:
.btn span
(Which would style all spans that are descendants of an element with the 'btn' class.)
Use the following instead
.btn span
Yes, .btn span is the proper syntax for the css since span is an HTML tag. The use of the period before the span would suggest it is a css class, which it is not.

hr has a black pixel underneath it?

We have a hr line and there is a weird black pixel underneath it.
Screenshot: http://i52.tinypic.com/2vwxy78.jpg
Our code:
HTML:
<hr />
CSS:
hr {
border-bottom: 1px solid #FFFFFF;
border-top: 1px solid #AAAAAA;
clear: both;
height: 0;
margin: 12px 0 18px;
}
Browser:
Firefox
Why is this pixel appearing underneath the <hr />? How do we fix this?
You need to reset all the border properties for the <hr>. Particularly the left border in your case. So:
border: 0;
border-bottom: 1px solid #FFFFFF;
border-top: 1px solid #AAAAAA;
....
Check it out - http://jsfiddle.net/uwed3/
You haven't removed the default style on the <hr> element.
Add this to your CSS:
border-left: 0;
And you should be fixed.