12. ID please CSS Selectors


#1

I am having trouble with the ID please CSS Selectors. I do everything correct but it says there is still a problem.

My Html is

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<!--Add your HTML elements with the ID "serious" below!-->
		<p class="serious">Hello</p>
		<p class="Happy">yolo</p>
	</body>
</html>

My CSS is
/*Define your CSS id #serious below!*/

#serious {
    font-family: Courier;
    color: CC0000
}
Happy {
    color: #CC0000;
    font-family: Courier;
}

What do I do?


#2

and,

both present with issues. When a selector is written in the form,

selector {

}

it denotes an HTML element node. HTML elements are themselves known as selectors, though not referred to as such in most instances. Ultimately, it would imply that such an element exists in the HTML language. P, DIV, UL, LI, &c. are all element nodes that are recognized in the DOM. serious and Happy are not.

It's also a general rule that selectors are not capitalized, so Happy would be better written as, happy. We still need to address the fact that they are not HTML elements. The exercise will have asked for either a class or an id and as the title suggests, it is ID. So your selectors, then, will be written with a hash, to denote an id attribute in the DOM.

#serious {

}
#happy {

}

#3

also, you gave your element classes:

		<p class="serious">Hello</p>
		<p class="Happy">yolo</p>

this should be id's

for next time, use one of the two following options to make your code/indent is visible:

select your code and press ctrl + shift + c (or cmd + shift + c if you use a mac)

if this instructions are unclear, you can also insert 3 backticks before and after your code, like so:

```
<p>visible</p>
```

the backtick is located above the tab key on your keyboard


#4

A post was split to a new topic: What is wrong with my coding


#8

This was my everything
Oops, try again. Did you give your new paragraph an ID of 'serious'?


#9

Please create a new topic with your code + error message + question