Another simple thing I am over looking somewhere

Ok, I am validating my xhtml and I am getting this

Line 162, Column 57: ID “contentTitle” already defined

ID “contentTitle” first defined here

Line 141 - <div id="contentTitle">.............</div>

Heres a bit of the code.

Line 162 - <div id=“contentTitle”>…</div>

Now I know I need to add class instead of ID, but I am confused on how to add that.

CSS

#contentTitle {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 16px;
	font-weight: bold;
	color: #06C;
	padding-left: 10px;
	padding-top: 10px;
	}

Now wouldnt I use something like

#contentTitle title2 {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 16px;
	font-weight: bold;
	color: #06C;
	padding-left: 10px;
	padding-top: 10px;
	}

I know I am missing something very simple to do with class, but I cant point my finger on it.

You can use an ID only once in a document which is why you’re getting that error.

You are correct in wanting to turn that ID into a class instead which allows you to use the same class as many times you want within a document.

In your CSS, you’ll need to change

#contentTitle

to

.contentTitle

The second rule you have is not a legal operation. You can’t have title2 in there as that is neither a standard element, nor is it a class or an ID.

An ID is always defined by a starting hash sign (#). A class is always defined by starting with a dot.

Ok, would I have to change the html

<div id=“contentTitle”>
to
<div class=“contentTitle”>

That worked, I sure appreciate you taking the time for me.