5

I am looking to create a dark mask at the bottom of a circle that is contained in the main circle.

can you do this using css masks?

Please see fiddle

<div id="profile-pic-wrap">
  <div id="profile-pic">
    <div class="profile-btn-bg">
      <a href="#" class="profile-pic-btn">Change Profile</a>
    </div>
  </div>
</div>

Thanks

web-tiki
  • 99,765
  • 32
  • 217
  • 249
user2965875
  • 701
  • 5
  • 11
  • 19

2 Answers2

6

You can use overflow:hidden; :

DEMO

changes to your CSS : added overflow:hidden; and text-align:center to #profile-pic

#profile-pic {
 position: absolute;
 z-index: 999;
 width: 200px;
 height: 200px;
 left: 33px;
 background: #FFF;
 border: 3px solid #FFF;
 border-radius: 100px;
 -webkit-border-radius: 100px;
 -moz-border-radius: 100px;
 top: 0px;
 position: relative;
    background:red;
    overflow:hidden;
    text-align:center;
}
.profile-btn-bg{
 position: absolute;
 background-color: black;
 width: 100%;
 height: 30%;
 bottom: 0px;
}

a.profile-pic-btn{
 color: #fff;
    
}
<div id="profile-pic-wrap">
  <div id="profile-pic">
    <div class="profile-btn-bg">
      <a href="#" class="profile-pic-btn">Change Profile</a>
    </div>
  </div>
</div>
web-tiki
  • 99,765
  • 32
  • 217
  • 249
2

Updated Demo

Added css:

overflow:hidden

and position fixed

Community
  • 1
  • 1
Manwal
  • 23,450
  • 12
  • 63
  • 93