MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

CEWP styling not working

  Asked By: Pankaj    Date: Feb 21    Category: MOSS    Views: 1285

On a MOSS site I customized the xslt of the DFWP, all is well. Then I added a
second WP, the CEWP and put the following in its "xml code" window pane.
This worked fine and I got red headings.

On a different site in the same farm I added 5-6 style classes to the asp
section "PlaceHolderTitleAreaClass" using SPD. Also put into it custom xslt of
the DFWP using these style class. All is fine.

Now I want to experiment in the UI. BUT, when I now add the CEWP to the page +
style mods so that I can "play" with display styles, it has NO effect. Simple
things like change border color never show.

Why isn't this CEWP overidding the styles as it did before and as the docs/specs
say it should?



7 Answers Found

Answer #1    Answered By: Anthony Rutledge     Answered On: Feb 21

Do the elements in question have either (a) explicit style attributes, or
(b) classes assigned directly?

Answer #2    Answered By: Heena Nagori     Answered On: Feb 21

No explicit syles in the elements. All style modifications applied by class, or
to ALL, say, <th> elements by specifying over-rides in a <style> .... </style>
section within the aspx page, and then a second time in the CEWP for

I have tried to switch my style (no pun intended) to do all my "decorating"
with css and not in-line.

Answer #3    Answered By: Aishwarya Karmarkar     Answered On: Feb 21

I just decided to look at both the working and non-working aspx pages using SPD.

I noticed that on the working page, I was over-riding a class provided by MS. I
have no idea where it came from, probably root site or master page (but does not

But on the non-working site, there is my styling on the aspx page AND a full
duplicate (with tweaks) on the CEWP. I could see its CDATA section via SPD.

So, is the answer as simple as my aspx page definition was always executing
last, and therefore my CEWP definition had no effect?

I thought I read from Heather Solomon that the CEWP is ALWAYS applied last.

Answer #4    Answered By: Janell Camacho     Answered On: Feb 21

The CEWP just renders your specified content in the place where you put it.
If there are linked stylesheets at the top of the page (where SP usually
puts them), those should be applied first.

Answer #5    Answered By: Julia Washington     Answered On: Feb 21

The order of loading for the CEWP vs. the rest of the page depends on the
order on the page.

Answer #6    Answered By: Shashwat Takle     Answered On: Feb 21

Changing CSS using the CEWP can be a very iffy thing. It all depends on the
order in which the styles are accessed on the page. If the CEWP is lower on
the page sometimes the HTML for an item is rendered before the CEWP is
rendered, so the style change doesn't take effect. I would recommend that
you stick to experimenting in the UI using SPD and then move the final CSS
to a more permanent custom CSS file after you decide what you want.

Answer #7    Answered By: Talia Johns     Answered On: Feb 21

I simply deleted all my CSS styling from the aspx page and applied it via the
CEWP to enable me to do "display" experiments. After I get it "right", I will
paste it back into the aspx page or put it in the style library at site root
and link it in.

Didn't find what you were looking for? Find more on CEWP styling not working Or get search suggestion and latest updates.