CSS and webparts

I created a web part page and added a few webparts.  I would like to change it up a bit with CSS but it's not my greatest strenght.

The code below is a section I would like to change.  I want the background-color to be #DDDDDD.

How would I do that in CSS?  I want to put it in a CEWP.

Thanks.
<table TOPLEVEL border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
					<tr class="ms-WPHeader">
						<td title="GA&amp;CKO Directors Hatch - Use for formatted text, tables, and images." id="WebPartTitleWPQ3" style="width:100%;"><h3 class="ms-standardheader ms-WPTitle"><nobr><span>GA&amp;CKO Directors Hatch</span><span id="WebPartCaptionWPQ3"></span></nobr></h3></td><td align="right" style="padding-right:2px"><div style="cursor: pointer" class="ms-HoverCellInActive" onmouseout="this.className='ms-HoverCellInActive'" onmouseover="this.className='ms-HoverCellActiveDark'"><nobr><a onclick="MSOWebPartPage_OpenMenu(MSOMenu_WebPartMenu, this, WebPartWPQ3,&#39;False&#39;);return false;" id="WebPartWPQ3_MenuLink" onkeydown="MSOMenu_KeyboardClick(WebPartWPQ3_MenuLink, 13, 40)" href="#"><img src="/_layouts/images/Menu1.gif" border="0" align="absmiddle" title="GA&amp;CKO Directors Hatch Web Part Menu" alt="GA&amp;CKO Directors Hatch Web Part Menu" style="padding-left:2px;" /></a></nobr></div></td>
					</tr>
				</table></td>
			</tr><tr>
				<td class="" valign="top"><div WebPartID="f9df9cbc-adb4-4224-91e6-d6ffa9bf57ea" HasPers="false" id="WebPartWPQ3" width="100%" class="ms-WPBody" allowDelete="false" style="" ><P align=center><FONT color=#000040 size=6><STRONG>The Director's Page</STRONG></FONT></P></div></td>
			</tr>
		</table>

Open in new window

LVL 5
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

svetayeCommented:
Hello,
To overwrite the CSS style for this table you need something to identify this table.Something like "id" or "name" or "class". You don't have any of them so as long as there no parent selectors in CSS you need to find any element that containf this table and have an "id" or "name" or "class" attribute.

Example:
<div id="webpartzone">
The code you have been posted
</div>

In other words : please post  here 10 additional lines of your source code that comes before the code you've been posted here before.
IsaacSharePoint Client Side DeveloperAuthor Commented:
Luckily, I just needed to add 1 line above what I posted.
<td id="MSOZoneCell_WebPartWPQ3" vAlign="top">
<table TOPLEVEL border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
					<tr class="ms-WPHeader">
						<td title="GA&amp;CKO Directors Hatch - Use for formatted text, tables, and images." id="WebPartTitleWPQ3" style="width:100%;"><h3 class="ms-standardheader ms-WPTitle"><nobr><span>GA&amp;CKO Directors Hatch</span><span id="WebPartCaptionWPQ3"></span></nobr></h3></td><td align="right" style="padding-right:2px"><div style="cursor: pointer" class="ms-HoverCellInActive" onmouseout="this.className='ms-HoverCellInActive'" onmouseover="this.className='ms-HoverCellActiveDark'"><nobr><a onclick="MSOWebPartPage_OpenMenu(MSOMenu_WebPartMenu, this, WebPartWPQ3,&#39;False&#39;);return false;" id="WebPartWPQ3_MenuLink" onkeydown="MSOMenu_KeyboardClick(WebPartWPQ3_MenuLink, 13, 40)" href="#"><img src="/_layouts/images/Menu1.gif" border="0" align="absmiddle" title="GA&amp;CKO Directors Hatch Web Part Menu" alt="GA&amp;CKO Directors Hatch Web Part Menu" style="padding-left:2px;" /></a></nobr></div></td>
					</tr>
				</table></td>
			</tr><tr>
				<td class="" valign="top"><div WebPartID="f9df9cbc-adb4-4224-91e6-d6ffa9bf57ea" HasPers="false" id="WebPartWPQ3" width="100%" class="ms-WPBody" allowDelete="false" style="" ><P align=center><FONT color=#000040 size=6><STRONG>The Director's Page</STRONG></FONT></P></div></td>
			</tr>
		</table> 
</td>

Open in new window

svetayeCommented:
Actually you need more because this "id" is dynamically generated id and can be changed if you will replace your web part in the feature. But we can do the trick with this dynamic id for now.
Please try this code for your CEWP:

this will set the background color for your table cells:
<style type="text/css">
#MSOZoneCell_WebPartWPQ3 table td
{
 background-color:#DDDDDD;
}
</style>

Open in new window


and this will set the set the background color for whole cell that contains your table:
<style type="text/css">
#MSOZoneCell_WebPartWPQ3
{
 background-color:#DDDDDD;
}
</style>

Open in new window

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

IsaacSharePoint Client Side DeveloperAuthor Commented:
It works but it's not working....here's what I mean

The following does not work:
<style type="text/css">
#MSOZoneCell_WebPartWPQ3
{
 background-color:#DDDDDD;
}
</style>

This works:
<style type="text/css">
#MSOZoneCell_WebPartWPQ3
{
 background-color:red;
}
</style>
svetayeCommented:
What about this:
<style type="text/css">
#MSOZoneCell_WebPartWPQ3
{
 background-color:#C1C1C1;
}
</style>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IsaacSharePoint Client Side DeveloperAuthor Commented:
Thanks!  Is there a reasone why #DDDDDD did not work.
svetayeCommented:
The only issue I can think about is the monitor issue.
Maybe you just can't see this color because it's too light on your display. Maybe you are working on the server via Remote Desktop?
This also can show you wrong colors.
IsaacSharePoint Client Side DeveloperAuthor Commented:
THANKS!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.