Border-Radius & Box-Shadow Not Rendering Correctly - css

I am trying to use box-shadow, and border-radius together on a webpage, and it is showing a white image that fills in the space where the radius is. Think of it like when you safe a "transparent" image in photoshop with a drop shadow, to a jpg, or png-8 file.
Here is an image to show you what I mean.
(i cant post images yet, but here is the link)
http://i.imgur.com/jDpIH.png
I am using this as my CSS
.whole
{
width: 1000px;
margin: 0 auto;
-webkit-box-shadow: 0px 3px 5px 2px #000000;
-mox-box-shadow: 0px 3px 5px 2px #000000;
box-shadow: 0px 3px 5px 2px #000000;
}
.top
{
height: 120px;
background-color: #1F1209;
margin-top: 50px;
-webkit-border-top-left-radius: 10px;
-webkit-border-top-right-radius: 10px;
-moz-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.footer
{
height: 250px;
background-color: #834C24;
-webkit-border-bottom-right-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-bottomright: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
So does anyone know if there is a way I can fix this? this is happening in Firefox and IE, by the way. I havent been able to check it out in other browsers though.
I would really prefer not to use a Photoshopped image... As CSS3 should definitely be used.
Any thoughts on this? I would greatly appreciate any help! :)
Thanks for your time folks!

A little tip for you
Use this css3 for shortcuts instead of adding -left -right- top
border-radius:0px 0px 0px 0px;
<!-- [top left] [top right] [bottom right] [bottom left] -->
That would be easier if you do that.
And as for the box-shadow... I don't know why it is like that but I used this code and it works perfectly well.
box-shadow:0px 0px 10px black;
<!-- in case you don't know ... [x coordinate] [y coordinate] [size of shadow] [color] -->
Well, I don't know if these codes will work on IE because I don't use IE browser and my computer will suddenly hang for a bit but... anyways.
I rewrite one of your class css code and I hope it work.
.footer
{
height: 250px;
background-color: #834C24;
border-radius:10px 10px 10px 10px;
box-shadow:0px 0px 50px black;
}
And I think even though you don't put -webkit- and -moz-, Mozilla and Chrome will read that. I hope it works on IE, too.
Anyways... that's it. Hope that'll work.

You probably have a background colour associated with the container.

The border-radius property is supported in IE9+, Firefox 4+, Chrome, Safari 5+, and Opera, because it is CSS3 property. The syntax is:
border-radius: 1-4 length|% / 1-4 length|%;
Example 1
border-radius:2em;
is equivalent to:
border-top-left-radius:2em;
border-top-right-radius:2em;
border-bottom-right-radius:2em;
border-bottom-left-radius:2em;
Example 2
border-radius: 2em 1em 4em / 0.5em 3em;
is equivalent to:
border-top-left-radius: 2em 0.5em;
border-top-right-radius: 1em 3em;
border-bottom-right-radius: 4em 0.5em;
border-bottom-left-radius: 1em 3em;

Related

Border not appearing continuous

I am trying to make an arc using border-radius like this (in chrome)
#elem {
border: 2px solid orange;
border-bottom: none;
width: 440px;
height: 60px;
border-top-right-radius: 220px 60px;
border-top-left-radius: 222px 60px;
}
but the arc is not continuous. if i remove the border-bottom property (which makes the bottom border also visible) it became continous. Making bottom-border color to transparent also doesn't help.
e.g. http://jsfiddle.net/kFxec/9/
Not able to understand what is wrong here?
I am trying this for chrome only. works fine in firefox
you could instead fake border with box-shadow : http://jsfiddle.net/ZC2m2/
#elem {
box-shadow:0 -2px 0 orange;
width: 440px;
height: 60px;
border-top-right-radius: 220px 60px;
border-top-left-radius: 222px 60px;
}
I would say that it is some kind of bug.
Seems related to the bottom border.
It disappears with this CSS
#elem {
border: 2px solid orange;
border-bottom: none;
width: 440px;
height: 60px;
border-top-right-radius: 220px 60px;
border-top-left-radius: 222px 60px;
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
What you see cutting the top border seems the bottom border doing strange things around. But giving it a moderate radius seems to somehow make it behave. (I don't know why)
fiddle

CSS3 issue with border-top and border radius

I am looking at adding a border-top, 20px solid red;, and I want the bottom of this to be rounded. With the following it does seem to be working for me.
-moz-border-radius-bottomright: 12px 12px;
border-bottom-right-radius: 12px 12px;
-moz-border-radius-bottomleft: 12px 12px;
border-bottom-left-radius: 12px 12px;
How can I do it?
I'm not sure why you aren't able to produce the result, but the above code looks correct. I've provided a JS Fiddle example, and mine works. I'm assuming you added the border-top property to the box. I don't think you need two values for each border-property. Hope this helps.
Create a new layer object with an ID of box and apply the following CSS. If you add a paragraph within the box the border will not appear.
http://jsfiddle.net/brownlace/kEvrE/1/embedded/result/
/* css3 rounded corners */
#box {
border-top: 20px solid red;
border-bottom-right-radius: 20px;
border-bottom-left-radius: 20px;
-moz-border-radius-bottomright: 20px;
-moz-border-radius-bottomleft: 20px;
}
I suggest you to use border instead of border-top to make sure the property is applied to all borders.
border: 20px solid red;
In this case you can use border-bottom-left-radius: 12px; with one value because both are the same.
Also you can add vendor property for webkit:
-webkit-border-bottom-right-radius: 12px;
-webkit-border-bottom-left-radius: 12px;
Here is a fiddle.

border-radius issue CSS

Having a bit of an issue with border-radius. I have successfully rounded off my rectangle, but I am having an issue with rounding the hover that I have placed over it. You will see in the top and bottom corners of the rounded rectangle the hover itself is not rounded and is actually a rectangle. I have tried rounding it but it rounds the center as well. I know this probably doesn't make sense but you will understand by looking here: http://jsfiddle.net/hCg3J/
All I want to do is to have each selection highlight the whole of that area, and not stick out.
HTML:
<ul class="pageitem">
<li class="list" style="border-top:none;">iPhone 4/4S</span><div class="arrow"></div></li>
<li class="list">iPhone 3G/3GS</span><div class="arrow"></div></li>
<li class="list">iPod Touch</span><div class="arrow"></div></li>
</ul>
CSS
.pageitem {
-webkit-border-radius: 8px;
behavior: url(/border-radius.htc);
border-radius: 8px;
position:relative;
zoom: 1;
-moz-border-radius: 8em;
-khtml-border-radius: 8px;
border-radius: 8px;
background-color: #fff;
border: #878787 solid 1px;
font-size: 12pt;
overflow: hidden;
padding: 0;
height: auto;
width: auto;
margin: 3px 9px 17px;
list-style: none
}
Just add proper -webkit-border-radius in .list:hover, name:hover and adjust it to your needs.
Here is a jsfiddle proof of concept. What you need to do is to round only top-left and top-right corner for top element and bottom-left, buttom-right for the bottom element. I would suggest adding a special class for these elements.
UPDATE:
Actually as I suggested in comment I have added first-child and last-child selectors, updated fiddle
.list:hover:first-child, name:hover:first-child {
-webkit-border-radius: 8px 8px 0px 0px;
}
.list:hover:last-child, name:hover:last-child {
-webkit-border-radius: 0px 0px 8px 8px;
}

CSS border radius is not curving the same on all side of the box

could anyone tell me why, if i use border-radius: 10px it doesn't round all the edges the same?
#portfolio1
{
background-image:url("images/bg.png");
background-repeat: none;
height: 150px;
width: 300px;
float: left;
margin-top:10px;
margin-bottom:0px;
margin-left:10px;
margin-right:10px;
border-radius: 10px;
/*border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;*/
/*-webkit-border-radius: 20px;*/
}
Notice I've commented a few lines of css where I was trying different things. I seems that if I to the individual border values to different for left and right edges it looks okay but still has something wrong with it.
Also the same with the webkit one. I'm using chrome, did try it with firefox as well but got the same problem. Could it be to do with the margin values I'm using? also I have portfolio1, portfolio2 and portfolio3 which are all very similar, but when displayed on my webpage I'm using each of them twice..... If that makes a difference.
Thanks for the help.
If you wanted to make all the edges round at 10px then you don't need to have it be so complicated (specifying topright,topleft,etc.)
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
Here's a very useful tool you can use.

image positioning with css in ie7 and ie6

I'm trying to position all images on my webpage behind a log-in screen but I can't seem to make that work. I've tried using z-index but that doesn't help either. I was wondering if anyone can help me sort this out. Here's a screenshot of my issue: http://img64.imageshack.us/img64/1267/uplad.png. I'm trying to make all images stay behind the black image with the log-in screen in front of everything.
CSS
CSS for images
img
{
-webkit-box-shadow: #666 0px 2px 3px;
-moz-box-shadow: #666 0px 2px 3px;
box-shadow: #666 0px 2px 3px;
border: 1px solid #ccc;
float: left;
background-color: #fff;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
z-index:0;
}
CSS for black background
element.style {
height: 1843px;
left: 0;
position: fixed;
top: 0;
width: 1263px;
z-index: 10000;
}
.modalBackground {
background-color: #000000;
opacity: 0.5;
}
CSS for Log-in Screen
element.style {
display: block;
margin-left: -225px;
margin-top: -212px;
}
.pagepopups .popup {
-moz-border-radius: 5px 5px 5px 5px;
-moz-box-shadow: 0 0 3px #333333;
background-color: #006699;
display: none;
left: 50%;
padding: 11px 10px;
position: absolute;
top: 50%;
z-index: 10001;
}
Z-index does appear to be what you want. There is a known z-index bug with Internet Explorer where it doesn't exactly follow the z-index as other browsers. Fortunately, there's an easy fix. You need to specify z-index on parent elements up until the container for all of the elements you're trying to specify a z-index for. I think the problem is that IE creates a "z-index context" for each element unless the parent element has a z-index. Here's a good link describing the issue and how to fix it.
You failed to make the image fully anonymous (Featured on .. button), I Googled for the live site, and it has the issue you're describing, so I'm assuming it's the same version you're working with.
Testing only in IE7:
Add to .header a single rule: z-index: 10000.
That's it fixed in IE7.
It will probably also be fixed in IE6, but if not, let me know and I'll take a look.
You're lucky you didn't anonymise it properly :)

Resources