YTD YTD - 7 months ago 10
HTML Question

HTML CSS works in one file but not another

I'm new to HTML and CSS and encountering a baffling problem. I created a very simple HTML file and then attempted to add some CSS to it. I could not get an external style sheet to work so I tried entering it internally. I got this to work but only with basic element selectors (it will not work with any id selectors). I was sure I was entering everything correctly though so I copied and pasted this example into a new html file. The example it worked as it should. So then I opened a new file and typed directly what was in the example into the new file myself word-for-word, and it doesn't work! I've gone over it countless times and there are no typos. What could possibly be causing this?

The code that works:

<!DOCTYPE html>
<html>
<head>
<style>
#para1 {
text-align: center;
color: red;
}
</style>
</head>
<body>

<p id="para1">My Name</p>
<p>Hi and welcome to my website.</p>

</body>
</html>


The code the doesn't work:

<!DOCTYPE html>
<html>
<head>
<style>
#para1 {
text-align: center;
color: red;
}
</style>
</head>
<body>

<p id=“para1”>My Name</p>
<p>Hi and welcome to my website.</p>

</body>
</html>

Answer
<p id=“para1”>My Name</p>

should be changed to

<p id="para1">My Name</p>