CSS selector question number 9 putting it all together


#1

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
	<id = "intro">
		<h2>Introduction</h2>
		</div>
		
		<div class = "standout">
		<h3>Classes and IDs in CSS</h3>
		<p>Classes and IDs are super easy in CSS. You're using them right now!</p> </div>
		
		<h3>Regular HTML Selectors</h3>
		<p>If you don't bother with a class or ID, an HTML element just gets
		   the regular CSS styling for that element—or the default styling if you
		   don't specify any particular styling on the stylesheet.
		</p>
	</body>
</html>
CSS
#intro{
    color:#B83C3A}
    
    .standout
    {
        
        font-family:Verdana;
        color: #F7AC5F;
    }

** Result on notepad++**
which appears to be right
but...codecedemy message saying
Oops, try again. Did you remember to add the intro ID to the h2 header??? pls advise



#2

Here is your h2 header element

<h2>Introduction</h2>

It has no id attribute.


#3

I placed

above

Introduction


??


#4

Placing it above it isn't the same thing as giving your h2 element an id attribute.


#5

Did you mean,

    <div id="intro">

Normal practice is not have any white space in attributes.

    <div class="standout">

That DIV is also missing an ENDTAG at the bottom.

    </div>
</body>

Another recommended practice is to not have anything above the <title></title) element except the character set declaration:

<head>
    <meta charset="UTF-8">
    <title>Closest to the top of the HEAD section</title>

CSS best practices (style guide)

  1. white space in selector: #intro {
  2. semi-colon after every declaration: color: #B83C3A;
  3. declaration block open on same line as selector: .standout {

#6

indent preformatted text by 4 spaces

ITS GONE THROUGH YEH!!!!!

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
	
	 <h2 id = "intro">Introduction</h2>
		</div>
	
		<h3 class="standout"> Classes and IDs in CSS</h3>
		<p class = "standout"> Classes and IDs are super easy in CSS. You're using them right now!</p> 
		
		<h3>Regular HTML Selectors</h3>
		<p>If you don't bother with a class or ID, an HTML element just gets
		   the regular CSS styling for that element—or the default styling if you
		   don't specify any particular styling on the stylesheet.
		</p>
		</div>
	</body>
</html>

#7

Thanks everyone for helping


#8

I would still suggest switching these two line around so the link follows the title. Best to start the practice sooner rather than later.


#9

k thanks will change that