The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Inner

effect Parent margin in CSS

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #32434

    Not sure if this is solved somewhere else, if it is… I’m sorry, for bringing it up again.

    Here is the problem…
    I have a heading html, thats pretty standard.


    body	{ position:relative;}

    .head { display:block; width:100%; height:120px; background-image:url(00.gif); background-repeat:repeat-x; position:inherit; z-index:20;}

    .wtf { width:750px; margin:40px auto; }

    Simple… no problem you’d think..
    but the 40px margin is beeing put on the class=”head” background image, so it “jumps down” 40 px from the browser window top. I put a border ( border:thin #000 solid; ) in the Class=”head” which solved the 40px margin jump, but then the page is to big for the browser window, and I get a scrollbar at the bottom, not to sexy…

    anyone have any ideas on how to solve this? am Im thinking wrong?


    Erm, you can use padding on the wtf element or, I think, you can add the property overflow: hidden to the head


    True… padding kind of works…
    not super happy with it but I guess it got to do :)

    overflow, dont, since the border is on the same Class, have to make a new div and Class/id with the overflow controller in it.

    but, way is it like that?
    anyone know way a “sub” Class is affecting the Parent?
    is it only Margins?
    or are there other element that the “sub” Class affect?


    Thanks TT_mark and Wolfcry911 for taking time to answer me :)

    It might have been a newbie question, but we all have to start somewhere.

    again thanks

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.