Web Development Blog

24K Design Studio :: Blog :: Space in CSS between brackets and characters.
Author:
Password:
Space in CSS between brackets and characters.
23:57, 16 Apr, 2011
by David

I usually think that in CSS, when there are brackets, I can ignore the spaces beside them. Do you agree?

For the following code:

<div style="background:url(images/zoomabg.png)repeat scroll 0 0 transparent;width:100px;height:100px;"></div>

The background image can be seen in chrome 10 and firefox 3.6

However, it cannot be seen in IE9 using IE8 mode!
It takes a long time to identify the problem, because the div has the correct width, correct height, correct x, correct y, correct display attribute and correct z-index. The problem is found to be about background only after border is added -_-|||

So, after lots of testing, I finally found that, the problem can be solved by simply adding a space between ")" and "repeat".

<div style="background:url(images/zoomabg.png) repeat scroll 0 0 transparent;width:100px;height:100px;"></div>

This will work.

Tags: CSS IE9
Reply:
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 = 

Reply
#1
jwytmnvv
05:03, 25 Nov, 2015
 
1
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 = 

Reply
View the latest 5 entries.