2. Taking up space


#1
* {
	border: 1px dashed blue;
}

div {
        display: block;
	height: 50px;
	width: 100px;
	border: 2px solid black;
	border-radius: 5px;
}

#one {
	background-color: #FF0000;
}

#two {
	background-color: #0000FF;
}

#three {
	background-color: #FFD700;
}

#four {
	background-color: #308014;
}

My code is above, but it cannot pass. Anybody help, thanks.


#2

I used your code in a windows 8.1 IE11 and got a pass...

Is your HTML-Code like:

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<div id="one"></div>
		<div id="two"></div>
		<div id="three"></div>
		<div id="four"></div>
	</body>
</html>

OR
maybe...
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


#3

Dear Leno,

I tried the ways you mentioned, still didn't work. I am using OS X El Capitan 10.11, Safari 9.0. Also I stuck at several other places, in which I am definitely sure that the codes I used are right.
Maybe there're problems with this CODECADEMY together with a Mac, of which I cannot confirm. However, it's quite frustrating.
Thanks anyway.

ADD: Don't know, but everything works well now, these problems are sorted. :smile:
Hope you the best.
Young


#4

same as you, can't pass.


#5

Do u fix it? I got the same problem... :sob:


#6

No, I think it's maybe a problem of CODECADEMY. I denefitely sure my code is right.
Just skip it and keep learning! :evergreen_tree:


#7

The same questions, I don't know why and how to do it?


#8

You might do a google search
== discussions / opinions ==
css background-color OS X El Capitan 10.11, Safari 9.0. site:stackoverflow.com

and you will find a set of article's......


#9

I found the same error, but I solved it finally.
See the attached pictures.

My solution is:
Change my Ip address(which is a China address, because I'm in China) to other place, like a USA IP address, then submit the page again, it does work.

You can try it.


#10

@xifengxx,
Maybe this helps...

++ jQuery not loaded n china.... $ is not defined..

In China because of the GFW,many websites won't work correctly. So jquery failed to react in codes below
《script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"script》 --->these codes just can't work.

You can use "http://libs.baidu.com/jquery/1.10.2/jquery.min.js" instead or use VPN to 科学上网


#11

Thanks for your information.
I noticed the page will load the codes:"ajax.googleapis.com/……",so I used the vpn to try it, and it worked.


#12

I'm a Chinese as you, and how can I change my IP?


#13

Well thank you.. it seems that I have to use a VPN...


#14

@swansong,

++ jQuery not loaded n china.... $ is not defined..

In China because of the GFW,many websites won't work correctly. So jquery failed to react in codes below
《script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"script》 --->these codes just can't work.

You can use "http://libs.baidu.com/jquery/1.10.2/jquery.min.js" instead or use VPN to 科学上网


#16

I just...can't get your meaning by "http://libs.baidu.com/jquery/1.10.2/jquery.min.js"...
But thank you all the same! (I'm a 小白.)


#17

"http://libs.baidu.com/jquery/1.10.2/jquery.min.js" works the same way as "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js". It is a bunch of codes we can get accessed to automatically by the CSS, Baidu serves the same methods as goolge, just because we cannot use google without VPN.
Have fun learning.


#19

Thank you very much! I tried everything in the most different topics and nothing worked.
I use uMatrix to block scripts and I have no problem keeping ajax.googleapis.com blocked, but for whatever reason it WAS needed here. Just allowed it to run, re-submited my code and voilà!


#20

Disabling any ad blocking addon you have might work, fixed it for me :smiley:


#23