csssharepoint-2010content-editor

Content Editor Web Part Not Applying Style


I'm having issues getting my CEWP to apply any of the code inside of it. There are no errors, no problems whatsoever, it just doesn't do anything.

I've tried putting the code directly inside of the CEWP or linking to the file. The link to the file works perfectly too.

Here are all combinations of code I have tried to add to the CEWP; perhaps someone can spot the mistake:

With the webpart id from webpage:

<script>
<style>
#WebPartTitleWPQ9 .ms-viewheadertr
{
display: none;
}
</style>
</script>

With the webpart id from SPD:

<script>
<​​style>
#g_daea6bc5_92ba_4702_9956_55d5077c4440 .ms-viewheadertr
{display: none;}
</style>​
</script>

I have also tried with and without the script tag, messing with the spacing, messing with lines, messing with indents and nothing changes whatsoever.

I just want to remove the header from WebPartTitleWPQ9. The style works just fine on the custom listview page when I add it directly to the page source, but the style doesn't remain when I add the list to other pages. I need the style to apply wherever the list is being used.


Solution

  • The name of the webpart needs to have "title" / "caption" omitted. The real name of the webpart is WebPartWPQ9 and not WebPartTitleWPQ9.

    Changing the css to:

    <style type="text/css">
       #WebPartWPQ9 .ms-viewheadertr
       {
          display: none;
       }
    </style>
    

    fixed it.