Hi,
I’ve been using IDs more than classes but have built a little ad box that may be used more than once on a page so when I use an ID, I can’t validate it with the CSS validator because I can use an ID only once on a page.
What’s the most efficient way to do this as a class? Is there a way without adding a class attribute to each h1, h2, and p?
Here’s the page:
http://acr.virtualpinpoint.com/templates/contentcenter/
Here’s the CSS:
#ad {width:165px;
background-color:#FFF;
border:1px solid #6F2C11;
margin:25px 10px;
padding:5px;}
#ad h1 { text-transform: uppercase;
font-size: 1.3em;
font-weight: bold;
text-align: center;
padding: 0 0 10px 0;}
#ad h2 {padding:0;
font-size:.9em;}
#ad p {font:.8em tahoma, arial, sans-serif;
text-align:left;
padding:0;
margin:0;
color:#000;}
Here is the markup:
<div id="ad">
<h1>Sample Ad</h1>
<h2>Special 1</h2>
<p>Ad text here describing special number 1.</p>
<hr />
<h2>Special 2</h2>
<p>Ad text here describing special number 2. You can link to <a href="/contact/">another page</a> or even <a href="http://google.com/" target="_blank">off the site</a>.</p>
</div><!--end ad-->