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?
 
svetayeCommented:
What about this:
<style type="text/css">
#MSOZoneCell_WebPartWPQ3
{
 background-color:#C1C1C1;
}
</style>
0
 
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.
0
 
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

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
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

0
 
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>
0
 
IsaacSharePoint Client Side DeveloperAuthor Commented:
Thanks!  Is there a reasone why #DDDDDD did not work.
0
 
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.
0
 
IsaacSharePoint Client Side DeveloperAuthor Commented:
THANKS!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.