HighDots Forums  

overwrite div properties

alt.html alt.html


Discuss overwrite div properties in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Clues
 
Posts: n/a

Default overwrite div properties - 04-10-2006 , 06:58 AM






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

Reply With Quote
  #2  
Old   
Steve Pugh
 
Posts: n/a

Default Re: overwrite div properties - 04-10-2006 , 07:23 AM






Clues wrote:

Quote:
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



Reply With Quote
  #3  
Old   
Clues
 
Posts: n/a

Default Re: overwrite div properties - 04-10-2006 , 07:52 AM




Quote:
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




Reply With Quote
  #4  
Old   
Clues
 
Posts: n/a

Default Re: overwrite div properties - 04-10-2006 , 08:26 AM




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

Thanks very much.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.