overwrite div properties

C

Clues

Hello,

I have a div element (id="content") that contains another div, named
"gallery".
Inside the div content element, I have this structure:
<h2></h2>
<p></p>
<h2></h2>
<p></p>
<h2></h2>
<p></p>

then I have
<h2></h2>
<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
 
S

Steve Pugh

Clues said:
I have a div element (id="content") that contains another div, named
"gallery".
Inside the div content element, I have this structure:
<h2></h2>
<p></p>
<h2></h2>
<p></p>
<h2></h2>
<p></p>

then I have
<h2></h2>
<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?

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

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

Steve
 
C

Clues

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

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



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;
text-align:justify;
}

#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.

Clues
 
C

Clues

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

Thanks very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top