|
Background not available in IE
09-07-2009, 08:49 PM
|
Background not available in IE
|
Posts: 128
Name: Chris Kummelstedt
|
Hey,
I have the problem that my background is not available in internet explorer, the problem started when I added more than one background: what is the best way around this problem?
Code:
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #68f72f;
background-image: url('./images/bg/ul.png'), url('./images/bg/ur.png'), url('./images/bg/bl.png'), url('./images/bg/br.png'), url('./images/bg/flower.png'),url('./images/bg/bg.png'), url('./images/bg/bgd.png');
background-position: top left, top right, bottom left, bottom right, center top, top left, bottom left;
background-repeat:no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat-x, repeat-x;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
http://www.freestarregister.com/chris/index.php
thanks for looking at my problem!
//Chris
Last edited by LadynRed; 09-08-2009 at 03:56 PM..
|
|
|
|
09-07-2009, 10:08 PM
|
Re: Background not available in IE
|
Posts: 101
|
You can't have more than one background image in CSS:
HTML Code:
background-image: url('./images/bg/ul.png'), url('./images/bg/ur.png'), url('./images/bg/bl.png'), url('./images/bg/br.png'), url('./images/bg/flower.png'),url('./images/bg/bg.png'), url('./images/bg/bgd.png');
So it's not just IE, the background isn't available in any browser. You can only have one background per element.
|
|
|
|
09-08-2009, 04:21 AM
|
Re: Background not available in IE
|
Posts: 128
Name: Chris Kummelstedt
|
Thanks for your reply T,
In Chrome, which I am using now, it displays all my background images though,
Does anyone know of a good solution to achieve the same thing in other browser?
|
|
|
|
09-08-2009, 04:22 AM
|
Re: Background not available in IE
|
Posts: 128
Name: Chris Kummelstedt
|
from: http://www.w3.org/TR/css3-background/
Quote:
3.1 Layering multiple background images
The background of a box can have multiple layers in CSS3. The properties ‘background-image’, ‘background-origin’, ‘background-clip’, ‘background-repeat’, ‘background-size’, and ‘background-position’ may have multiple comma-separated values. If the values are specified as follows:
background-image: w1, w2, w3,…, wM
background-repeat: x1, x2, x3,…, xR
background-size: y1, y2, y3,…, yS
background-position: s1, s2, s3,…, sP
then the number of layers is N = max(M, R, S, P)
Each of the properties is interpreted as if it had N values, by repeating the specified values like this:
background-image: w1,…wM, w1,…wM, w1,… /* N values */
background-repeat: x1,…xR, x1,…xR, x1,… /* N values */
background-size: y1,…yS, y1,…yS, y1,… /* N values */
background-position: s1,…rP, s1,…rP, s1,… /* N values */
|
|
|
|
|
09-08-2009, 04:42 AM
|
Re: Background not available in IE
|
Posts: 101
|
Sorry Chris, I wasn't aware that this was a possibility. This must be one of those new css rules being introduced, making it possible to do a lot more with css than the usual. Usually it's firefox and safari that handle these new rules but this particular rule works as you said in Chrome and also Safari. I also tested it on IE 7 and 8, Opera and FF and it didn't work on any of those. Since this method isn't compatible with all browsers it may not be a good idea to use it.
Here are two other css methods that only work on FF and Safari:
http://www.sitepoint.com/blogs/2008/...ons-and-masks/
http://www.the-art-of-web.com/css/border-radius/
Until recently these two things (gradients and rounded borders) could only be achieved via images but now css is attempting to introduce new rules to achieve them via css alone. Only when all browsers accept them will any of these be viable options...
|
|
|
|
09-08-2009, 05:17 AM
|
Re: Background not available in IE
|
Posts: 128
Name: Chris Kummelstedt
|
thanks Towhid,
do you know a good way to make a similar looking design? is having a background div somehow a good option?
thanks for the help!
Chris
|
|
|
|
09-08-2009, 05:19 AM
|
Re: Background not available in IE
|
Posts: 128
Name: Chris Kummelstedt
|
btw, im very new to all this but css is amazing,
|
|
|
|
09-08-2009, 06:12 AM
|
Re: Background not available in IE
|
Posts: 101
|
The only way to have a full sized background like that is to combine all the images together into one and set that as the background of the body.
If you do this be sure to optimize the image to reduce it's file size otherwise a large background image can really slow down page load.
Last edited by Towhid; 09-08-2009 at 06:18 AM..
|
|
|
|
09-08-2009, 03:58 PM
|
Re: Background not available in IE
|
Posts: 10,016
Location: Tennessee
|
Not all browsers support all features of CSS 3 yet, so it's only going to work right in those browsers that support that feature, the rest, like IE, will not work with that.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
Please login or register to view this content. Registration is FREE
Please login or register to view this content. Registration is FREE
|
|
|
|
|
« Reply to Background not available in IE
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|