我希望在主圆圈中包含的圆圈底部创建一个暗色蒙版. 你能用css面具吗? 请参阅fiddle div id="profile-pic-wrap" div id="profile-pic" div class="profile-btn-bg" a href="#" class="profile-pic-btn"Change Profile/a /di
你能用css面具吗?
请参阅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>
谢谢
你可以使用overflow:hidden; :DEMO
更改CSS:添加溢出:隐藏;和text-align:center到#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>