Weird dark border :after css arrow in Firefox - html

In an attempt to make an arrow in pure CSS for my tooltip, I ran across a problem in Firefox:
I tried to find what was causing the dark border in Firefox without success.
Here is a jsfiddle and a running snippet demonstrating the problem:
.tooltip {
position:relative;z-index:1;
display:inline-block;padding-right:10px;
}
.tooltip .info {
position:absolute;left:100%;top:-7px;
display:block;padding:7px;border:1px solid #cccccc;
background:#fff;
-webkit-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 1px 1px 8px 0px rgba(0, 0, 0, .2);
box-shadow: 1px 1px 8px 0px rgba(0, 0, 0, .2);
}
.tooltip .info img {float:left;}
.tooltip:after {
content: '';
position:absolute;top:0;left:100%;
display:block;
width:0;
height:0;
margin-left:-13px;
border:0 solid transparent;
border-right-color:#cccccc;
color:#ccc;
}
.tooltip .info:after {
content: '';
position:absolute;top:7px;left:-12px;z-index:10;
display:block;
width:0;
height:0;
border:transparent solid 6px;
border-right-color:#fff;
color:#ccc;
}
<a class="tooltip">Test for tooltip<span class="info">My tootip information</span></a>
This second demo demonstrates that background transparent is the root cause as replacing transparent by a color results in the same render in Chrome and Firefox.

2015's EDIT
Now it works by using both RGBa and transparent; appearently, the Bug has been resolved (maybe incidentally, because it is still in state NEW , instead that on FIXED).
If it still happens to you, you're probably running an old FireFox version (the current one is 38.0.5), and you can use the workaround in the answer to overcome the problem.
It is the
Bug 646053 - dark diagonals at corner joins adjacent to transparent borders
The workaround is to use RGBa instead of transparent:
/* old */
border: transparent solid 6px;
border-right-color: #fff;
/* new */
border: rgba(255,255,255,0) solid 6px;
border-right-color: #fff;

Related

CSS create border on one side with sharp square edges

everyone, I am trying to add border to one side of a a element, however, when I add it to one side it give it a sharp diagonal edge:
I am trying to remove the sharp edge and make it a square.
I have tried using pseudo-elemnts to achieve this but I have had no luck:
Currently, I am using:
a{
border-left: 2px solid rgba(0, 0, 0, 0.9) !important;
border-left-width: 0;
border-radius: 0px;
position: relative;
}
a::before{
border-left: 2px solid rgba(0, 0, 0, 0.9) !important;
border-radius: 0px;
position:absolute;
content:'';
}
But this is still giving me the results below. How can I do this successfully?
See if this works for you:
box-shadow: -10px 0 0 0 black;
Just that, no borders.

CSS: Box Shadow Effect on Scalene Triangle PseudoElement

I am trying to create a box shadow around a scalene triangle that exists as a pseudo element, as shown below. I have tried many ways but cannot seem to get an even shadow below my image.
I have tried putting a second scalene triangle pseudo element with slightly larger dimensions that is grey but since there is no gradient or shadow effect, it is not what I am looking for.
Does anyone have any solutions?
Would really appreciate some ideas; perhaps there is a way to get a border gradient effect on a second pseudo element and underlay it?
.box {
height: 100px;
width: 100px;
background: blue;
position: relative;
box-shadow: 0 40px 5px 0 rgba(0, 0, 0, 0.50);
}
.box:after {
content: '';
position: absolute;
top: 100%;
left: 0;
right: 0;
border-left: 20px solid transparent;
border-right: 80px solid transparent;
border-top: 30px solid blue;
}
<div style='width: 300px;height:300px;background: white;'>
<div class='box'>
</div>
</div>
What you're looking for is filter!
filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
Maps the shadow around the visible parts of the element, instead of its box.
Note that this property is significantly different from and incompatible with Microsoft's older "filter" property.
You can have a look on this fiddle I have made: https://jsfiddle.net/1fwrn3wh/1/.
The steps you need to do:
Add a :before pseudo element which the same size of :after element
Slightly move :before element downward
Add the filter with blur aspect
Then it will alike the shadow ;)
For your quick editing, you can add this CSS into your file:
.box:before {
content: '';
position: absolute;
top: 105%;
left: 0;
right: 0;
border-left: 20px solid transparent;
border-right: 80px solid transparent;
border-top: 30px solid rgba(0, 0, 0, 0.5);
filter: blur(2px);
}
And then change the box-shadow of the original box:
box-shadow: 0 5px 5px 0 rgba(0,0,0,0.50);
Cheer ;)

Css inside-out vignette/glow effect

I have a div with a vignette effect.
<div id="box" class="glow"></div>
#box
{
padding:10px;
border:solid 1px #ddd;
width:100px;
height:400px;
position:relative;
}
.glow:after
{
-webkit-box-shadow:inset 0px 0px 70px #CE1A1A;
-moz-box-shadow:inset 0px 0px 70px #CE1A1A;
box-shadow:inset 0px 0px 70px #CE1A1A;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: "";
}
Here's the jsfiddle: http://jsfiddle.net/bEFha/
But what I am really after is a glow from the inside out. So red in the center and white in the sides. The effect I'm trying to achieve is as if there is a red light source shining from underneath the div.
I've tried various things but just not able to the vignette effect to spread out from the center.
Any help is appreciated.
UPDATE: If possible I would like to not modify the background property of #box as I need that to be white.
You could use a radial-gradient background.
See: https://developer.mozilla.org/de/docs/Web/CSS/radial-gradient
Here's a very basic example, you could tweak: http://jsfiddle.net/bEFha/5/
background-image: radial-gradient(farthest-corner at center center, #CE1A1A 0%, #ffffff 100%);
I also find this visual editor very helpful http://www.visualcsstools.com/
I'm not quite sure what your after, but by playing around I got this:
box-shadow:inset 0px 3px 20px 10px #FFF;
background-color: #CE1A1A;
Fiddle Here
Try this vintage effect Demo
Just give background color to the box and you will get cool vintage effect.
#box{ background:#FFE4E4; }
UPDATED ANSWER:
Demo
CSS Changes
#box:after{
content:"";
background: #CE1A1A;
opacity:0.5;
}
.glow:after {
-webkit-box-shadow:inset 0px 0px 120px #fff;
-moz-box-shadow:inset 0px 0px 120px #fff;
box-shadow:inset 0px 0px 120px #fff;
}
Your #box is still white but I added #box:after to make it red.
Demo with Image

box-shadow is not working in ie-8

Hi in my code box shadow is not working properly for i-e 8
here is my css
.lt-ie9 .imageonHover:hover {
box-shadow:1px 1px 5px 5px #E7E0E7;
border-radius:3px;
zoom: 1;
filter:
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=0,strength=1),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=45,strength=1),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=90,strength=2),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=3),
progid:DXImageTransform.Microsoft.Shadow(color=#cccccc,direction=180,strength=10),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=225,strength=3),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=270,strength=2),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=315,strength=1);
}
.imageonHover:hover {
width:100%;
height:100%;
position: relative;
border-radius:3px;
box-shadow:1px 1px 5px 5px #E7E0E7;
-webkit-box-shadow:1px 1px 5px 5px #E7E0E7;
-moz-box-shadow:1px 1px 5px 5px #E7E0E7;
}
When i hover on div , the text is also showing shadow.On other browsers it is working fine but on ie 8 it is not working
Use CSS3 PIE, which emulates some CSS3 properties in older versions of IE.
It supports box-shadow (except for the inset keyword).

border-radius working in all browsers, except IE9

On my new site border-radius doesnt seem to be working.
I can see the border curving, but the background doesn't.
border-radius should work.
following works in IE 9
http://jsfiddle.net/Ec86p/3/
if supporting border-radius in IE7/IE8 is not a requirement then you should not include CSS3PIE as IE9 inclues support of border-radius css property.
edit:
i have updated your fiddle
http://jsfiddle.net/Zr8vE/3/
and changed following:
#main-menu li.first{
border-left:1px solid #feb800;
border-top-left-radius: 5px 5px;
-moz-border-top-left-radius: 5px 5px;
-webkit-border-top-left-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
-moz-border-bottom-left-radius: 5px 5px;
-webkit-border-bottom-left-radius: 5px 5px;
padding-left:10px;
}
edit : # 2
as soon as i removed following from ( #main-menu li )
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fe9900', endColorstr='#ff7c00',GradientType=0 );
it started working. ( I tried it in IE 9, orange background seems to be curving similar to border )
http://jsfiddle.net/Zr8vE/15/
in fact, it is not only the IE9, but also IE9 -.
you can either follow #Bert answer, or you can try CSS3PIE
the usage is just the same, but CSS3PIE provide more CSS3 features for IEs.
i think this is the solution you needed.
in your css apply this to the element that needs the rounded corner
#element{
behavior: url(border-radius.htc);
}
download and search it in google border-radius.htc and save it in your image folder or anywhere you like it is an image with curve and it is use to fix IE problem.
I will post my css for my main menu that works for me with rounded border.
#main-nav {
width: 100%;
background: #ccc;
margin: 0;
padding: 0;
position: absolute;
left: 0;
bottom: 0;
z-index: 100;
/* gradient */
background: #6a6a6a url(images/nav-bar-bg.png) repeat-x;
background: -webkit-gradient(linear, left top, left bottom, from(#b9b9b9), to(#6a6a6a));
background: -moz-linear-gradient(top, #b9b9b9, #6a6a6a);
background: linear-gradient(-90deg, #b9b9b9, #6a6a6a);
/* rounded corner */
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
/* box shadow */
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 1px rgba(0,0,0,.4);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 1px rgba(0,0,0,.4);
box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 1px rgba(0,0,0,.4);
}
Please try this.
here is the link http://jsfiddle.net/vZaJX/
Hope it helped.
Here is now the answer.
try to just edit the spacing of the words.
http://jsfiddle.net/ApYw4/
for IE 9 solution as i have told you
download this border-radius.htc and add to your css like this
#main-menu{
behavior: url(border-radius.htc);
//all css
}
Dont hesitate to correct me if anything wrong.