CSS not applying anything to my class

So this is my html code:

<!DOCTYPE html>
<html>
	<head>
	
		<link type="text/css" rel="stylesheet" href="stylesheet3.css">
	</head>
	<body>
		<div id=”first”>
			<span class=”red”>This is a DIV Container</span>
		</div>
		<div id=”second”>
			DIVs are a powerful way to modularize presentation
		</div>
	</body>
</html>

and this is my css code:


div {
    position:absolute;
	padding:5px;
	border: 2px dashed green;
	width:200px;
	height:200px;
	text-align:center;
}
.red{
   color:red;
   font-weight:bold;
}

my html works for the div part but not for the red. and I can’t figure out for the life of me why. any hints or advice??

The only thing I see is that you are using closing quotes (”) rather than straight ones (").

2 Likes

Thanks for catching that, I missed what is probably something a lot have experienced -
Text Editor choice.

If you are copy - pasting, please do not use a desktop app that is better suited for print purposes.

Another good habit -
Validate
The W3C Markup Validation Service

Well I’m on my cell phone right now but that seems like something I’d do. I copy pasted it from a pdf. So that would make much sense. Thanks for noticing it haha.

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