overwrite div properties

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a div element (id="content") that contains another div, named
Inside the div content element, I have this structure:

then I have
<div id='gallery'><p><img /></p></div>

Now: I don't want this div (gallery) to inherit from its parent some
properties (or having the possiiblity to overwrite some).

Is it possible?

Thanks, Clues

Re: overwrite div properties

Clues wrote:

Quoted text here. Click to load it

Yes. It's pretty much the standard behaviour for CSS.

What have you tried and what problems have you run into?


Re: overwrite div properties

Quoted text here. Click to load it

Hello, and first of all, thanks.

Simply, it seems the properties I declare in the content are ADDED (not
substitued, as I thought it could be) to the ones I declare in the
contained div.

#content {
    float: left;
    width: 440px;
    margin: 8px 0 0 4px;

#content img {
    padding: 3px;
    margin: 2px 12px 0px 0px;
    border: 1px solid #06598E;
    float: left;

#content p {
    margin-bottom: 20px;
    padding-left: 14px;
    padding-right: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
    background: #fff;

#gallery img {
padding: 3px;
margin: 1px 1px 1px 1px;
border: 1px solid #000000;

If I insert an image (400 px large) inside "gallery",
it creates a lot of space around it. So, I would like #gallery "to
reset" the things in some way, while preserving its position inside the
content div.


Re: overwrite div properties

I'm terribly sorry:
I think I was updating and uploading two different files.

Thanks very much.

Site Timeline