Using Zen theme.

I have created a custom node type.

When I edit the .node class - it themes the appearance of just the node and the content.

However, when I apply styles to .node-type-mycustomnode it seems to change the apearance not only of the node - but also of the blocks on the same page and the whole page itself - even going as far as to give the entire screen a border...

How can I keep the style of my custom node - applying only within the box of that node?

p.s. I might also ask why theming links in my comments.css affects the main navigation bar... but links are, I guess, a pain and a right of passage for every new drupaller :)

Comments

shruti.sheth’s picture

Hello,

1.The above issue may be due to :

The .node class is present only inside the node id class i.e

     <div id="node-1" class="node node-type-my-content node-promoted node-by-viewer clearfix" >

but the .node-type-mycustomnode class is present in both the
->body class of that node i.e

        <body class="not-front logged-in node-type-my-content page-node-1 section-node two-sidebars admin-menu">

and

->the node id of that particular node i.e.

<div id="node-1" class="node node-type-my-content node-promoted node-by-viewer clearfix" >

So if .node-type-mycustomnode class is given it applies css to the box of that node and the body also.

SOLUTION::

#content .node-type-my-content {
  border: 1px solid red;
}

or simply

.node {
  border: 1px solid red;
}

2. Please check
I tried applying css to ul.links in comment.css it works fine.
It does not affect the appearance of navigation bar.

Thanks,
Shruti

Anonymous’s picture

All sorted - good answer thank you!

Anonymous’s picture

Status: Active » Closed (fixed)