How to change the background color of a specific node ?

Comments

xjm’s picture

Well, the easiest way would be to add a wrapper div to the node and then style that wrapper in CSS. E.g., say the body of your node looks like this:

<p>This is the body of my node</p>
<p>I like the following animals:</p>
<ul>
<li>turtles</li>
<li>snakes</li>
<li>eels</li>
<li>bunny rabbits</li>
</ul>

Change it to this:

<div class="super_special_bgcolor_style">
<p>This is the body of my node</p>
<p>I like the following animals:</p>
<ul>
<li>turtles</li>
<li>snakes</li>
<li>eels</li>
<li>bunny rabbits</li>
</ul>
</div>

and add the following CSS to a stylesheet for your theme to make the node have a red background:

DIV.super_special_bgcolor_style {
margin: 0px;
padding: 0px;
border: none;
background-color: red;
}

That's not the best way to do it if you want to do it more than once, but it gets the job done.

=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE

ica’s picture

errr, maybe not :) after trying the module i realised it does not have css functions but does other rather clever thing that overrides PHPTemplate variables.

would be nice if also overwrite CSS the styles though

phicarre’s picture

I didn't find node_style.module, Could you explain ?

xjm’s picture

http://drupal.org/project/node_style

(I've never used it, but thought I'd help you with the link.)

You can find modules by going to the "Downloads" tab here at drupal.org and clicking on "Modules." The "Browse by name" tab will list all the contributed modules that are not included with the Drupal core.

=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE

phicarre’s picture

I mean I didn't find for the 5.x version ...

xjm’s picture

Then I'm guessing there isn't a 5.x version yet. :)

=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE