Id element (don't know what I did wrong)


#1


https://www.codecademy.com/en/courses/web-beginner-en-WF0CF/2/4?curriculum_id=50579fb998b470000202dc8b#


The instruction told me to change the color and font of h2 with id element. So I wrote it like how I attached it below. But nothing changed. Did I make a mistake or wrote something wrong?


	<h2 id="intro">
		<h2>Introduction</h2>
	</h2>


#intro {
    color: #B83C3A;
    font-family: Cursive;
    }


#2

Its due to this. I am not sure why you wrapped a h2 tag around another h2 tag but it complicates things. Simplify it so it looks like this.

	<h2 id="intro">Introduction</h2>

#3

The top half of the code looks like this.
So if I want to add an "id" element to "h2", then what should I type?

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<h2>Introduction</h2>
	<div class="standout">
		<h3>Classes and IDs in CSS</h3>
	</div>

Do I still write <h2 id="intro">Introduction</h2> ?


#4

Yeah you need to add id="intro" to the above. Making it <h2 id="intro">Introduction</h2>.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.