overwrite div properties

Discussion in 'HTML' started by Clues, Apr 10, 2006.

  1. Clues

    Clues Guest

    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
     
    Clues, Apr 10, 2006
    #1
    1. Advertising

  2. Clues

    Steve Pugh Guest

    Clues wrote:

    > 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
     
    Steve Pugh, Apr 10, 2006
    #2
    1. Advertising

  3. Clues

    Clues Guest


    > 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
     
    Clues, Apr 10, 2006
    #3
  4. Clues

    Clues Guest

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

    Thanks very much.
     
    Clues, Apr 10, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Um9iZXJ0?=

    Deployment in 2.0 - How To Not Overwrite web.config

    =?Utf-8?B?Um9iZXJ0?=, Nov 2, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    4,517
    Juan T. Llibre
    Nov 3, 2005
  2. VisionSet
    Replies:
    1
    Views:
    4,206
    Adam Lipscombe
    Sep 2, 2003
  3. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    809
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    236
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    357
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page