Forums

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

Home Forums CSS Transparency Parent / Child Problem

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #210470
    andschreiner
    Participant

    Hi there,

    I can’t really explain my problem, so here is a little picture:

    http://andschreiner.com/container/css_example.png

    The .circle has no background – but the .redBOX background is there…

    Is it possible to do that like in the picture?

    sry for my bad english.

    #210471
    Paulie_D
    Member

    Possibly…what have you tried?

    However, in general, you can’t “cut-through” backrounds of parent elements.

    Will the red box have content?

    #210472
    Paulie_D
    Member

    You can fake that sort of thing though.

    http://codepen.io/Paulie-D/pen/zvLpJY

    #210476
    andschreiner
    Participant

    #210479
    andschreiner
    Participant

    thank you for the fast answer.

    my first try
    http://codepen.io/andschreiner/pen/NGBYGx

    • your solution with the border is pretty awesome.
    • But if the redBox has content, it doesn’t work.
    • Also the support of safari isn’t working.
    <div class="red-box">
        <div class="child"></div>
        <div class="content">asdfasdf</div>
      </div>
    
    .content {
         z-index:9;
    }
    

    this one isn’t working either.

    #210480
    Paulie_D
    Member

    As I said, it’s not easy.

    You might want to look as SVG images or masking.

    #210481
    Paulie_D
    Member

    your solution with the border is pretty awesome.

    It’s not a border, it’s shadow..but thanks.

    But if the redBox has content, it doesn’t work.

    It can…it depends on what layout you want.

    http://codepen.io/Paulie-D/pen/epjMKr

    Safari : It should but I can’t test.

    http://caniuse.com/#feat=css-boxshadow

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