#9 Many Selectors ,Many properties: Please Help!


#1


https://www.codecademy.com/courses/web-beginner-en-TlhFi/1/3?curriculum_id=50579fb998b470000202dc8b
I have written the code below in the exercise Html /CSS but when i run the code i keep getting the error message" Oops try again,Make sure you set your p tags to font-family: Courier!".Is something wrong with my code cause Iam stuck.


<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>I Know Kung Fu (er, CSS)</title>
	</head>
	<body>
		<div>
			h3 {
			color: red;
			} 
			What's CSS for?
			p {
                       font-family: Courier;
                      CSS is for styling HTML pages!
	        	h3 {
			color: red;
			} 	
			Why use it?
			p {
                       font-family: Courier;
            }
			It makes webpages look <span style="background-color: yellow;">really rad</span>.
			h3 {
			color: red;
			} 
			What do I think of it?
			p {
			font-family: Courier;
			}
			It's awesome!
		</div>
	</body>
</html>


#2

It looks like you might be getting CSS and HTML mixed up. At the top of the middle display you should see 2 tabs. Put your CSS in the stylesheet.CSS tab and it should work. If you need any more help let me know :slight_smile:


#3

Also you appear to have written the CSS 3 times. You'll only need it one time, once you place it in the right folder.


#4

Hi ghughe13
Thanks for your help.Actually the exercise requires me to edit the code in an index.html file.To get more insight,could you kindly click on the link that i provided which leads you to the exercise.


#5

I think there might be misunderstanding. You don't need to edit anything in the index.html file for this exercise. Switch to the stylesheet.css file and apply your code there and it should work.


#6

Thanks a lot .let me try that.


#7

Hi,

I just put my code in the stylesheet.css and it still gives me the same error.


#8

Could you post your updated code please? And while the way you styled the span tag in the index.html file accomplishes the same thing, for this exercise you probably need to style the span tag in the .CSS file.


#9

What i actually did,was copy and paste the code into CSS.I was learning html and now iam now being introduced to CSS.So iam not sure about the syntax to input into the stylesheet.css.So could you help in that regard cause I am clueless as to where to start.


#10

No worries, we've all been there.

Check this out http://www.w3schools.com/css/css_syntax.asp

They can probably explain the syntax of CSS better than I can.

It's basically this though:

p {
     font-family: Courier. 
}

Selector = p
Opening tag= {
styling = font-family: Courier
closing tag = }


#11

That much i had done and been to that site too.the syntax is correct but can't get why it won't run.If iam to put my code into stylesheet.css.what do i write in the and the link type.but let me revisit the site again anyway.


#12

Oh disregard that then lol

Could you copy and paste what you have in your stylesheet.css file and index.html file so I can see what the updated code looks like please :slight_smile:


#13

There you are,the code in CSS I mean.I have been researching this issue since Sunday and I wanna move forward.the syntax seems simple to grasp but can't jus get it to run.

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>I Know Kung Fu (er, CSS)</title>
	</head>
	<body>
		<div>
			h3 {
			color: red;
			} 
			What's CSS for?
			<p>CSS is for styling HTML pages!</p>
	    	h3 {
			color: red;
			} 	
			Why use it?
			p {
            font-family: Courier;
            }
			It makes webpages look <span style="background-color: yellow;">really rad</span>.
			h3 {
			color: red;
			} 
			What do I think of it?
			p {
			font-family: Courier;
			}
			It's awesome!
		</div>
	</body>
</html>

Here is the code in HTML below:

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>I Know Kung Fu (er, CSS)</title>
	</head>
	<body>
		<div>
			h3 {
			color: red;
			} 
			What's CSS for?
			<p>CSS is for styling HTML pages!</p>
	    	h3 {
			color: red;
			} 	
			Why use it?
			p {
            font-family: Courier;
            }
			It makes webpages look <span style="background-color: yellow;">really rad</span>.
			h3 {
			color: red;
			} 
			What do I think of it?
			p {
			font-family: Courier;
			}
			It's awesome!
		</div>
	</body>
</html>

#14

I have noticed the code looks the same as in the one i originally posted above.


#15

HI did you try to remove the text between the selector in the css code?

3 {
color: red;
} 
What's CSS for?
CSS is for styling HTML pages!


h3 {
color: red;
} 
Why use it?
p {
font-family: Courier;
}
It makes webpages look really rad.
h3 {
color: red;
} 
What do I think of it?
p {
font-family: Courier;
}
It's awesome!

like that

h3{
color: red;
} 


h3 {
color: red;
} 

p {
font-family: Courier;
}

h3 {
color: red;
} 

p {
font-family: Courier;
}

#16

Hi Wizmarco

I haven't tried it but let me try and give you fedback.


#17

Yea @wizmarco has it. Just take out the text in between and it'll work a lot better. Also in CSS if you make a selector like

h3 {
color: red;
}

It selects all h3 elements so you only need to write it once.


#18

Hi Wizmarco and Ghughes13,I have remove the text between the selectors in CSS and iam still getting the Opps,make sure you set your p tags to font-family: Courier!:tired_face:


#19

Hi,

Can you paste in your updated code..

Remember this code is css and belong under .css tab:

h3 {
color: red;
}

#20

Here is my updated code:Should i also remove the doctype,and and all the other tags up to the dv tag?

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>I Know Kung Fu (er, CSS)</title>
	</head>
	<body>
		<div>
			h3 {
			color: red;
			} 
		
			p {
			font-family: Courier;
			}
			
	    	h3 {
			color: red;
			} 	
			
			p {
            font-family: Courier;
            }
			
			h3 {
			color: red;
			} 
			
			p {
			font-family: Courier;
			}
		
		</div>
	</body>
</html>