html - Overlay individual Div's -
html - Overlay individual Div's -
i trying set overlay on top of div on page if not subscribers button subscribe site in center of it. having issues getting overlay onto right div , not within of it.. gray out...
have actual css of span5 , console @ end of post
i have page next html:
<div class="row-fluid"> <div class="span2 well> ... </div> <div class="span5 well"> <h3>ez search</h3> <a class="btn btn-primary" href="/searches/new">advanced search</a> <hr/> <%= render partial: "searches/ezsearch", locals: {search: @search, user_id: current_user.id} %> </div> <div class="span5 well> ... </div> </div>
here image of page have now:
and want kinda this:
this have in css:
.overlay{ z-index: 20; width: 100%; height: 100%; position: absolute; } .overlay .blackbg { z-index: 25; color: #000; background-color: #000; -ms-filter: "progid:dximagetransform.microsoft.alpha(opacity=50)"; filter: alpha(opacity=50); opacity: 0.5; } .overlay .button { z-index: 30; color: white; }
here css of span5 , well
.row-fluid .span5 { width: 40.1709%; } .row-fluid [class*="span"] { -moz-box-sizing: border-box; display: block; float: left; margin-left: 2.5641%; min-height: 30px; width: 100%; } .row-fluid .span5 { width: 40.4255%; } .row-fluid [class*="span"] { -moz-box-sizing: border-box; display: block; float: left; margin-left: 2.12766%; min-height: 30px; width: 100%; } .well { background: none repeat scroll 0 0 #e6e6e6; box-shadow: 3px 3px 5px 6px #cccccc; } .span5 { width: 470px; } [class*="span"] { float: left; margin-left: 30px; min-height: 1px; } .well { background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px 4px 4px 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; margin-bottom: 20px; min-height: 20px; padding: 19px; } .span5 { width: 380px; } [class*="span"] { float: left; margin-left: 20px; min-height: 1px; }
you can simplify overlay styles so:
.overlay{ z-index: 20; width: 100%; height: 100%; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); /* give 50% black background without element */ color: #000; } .overlay .button { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); /* object aligned centered based on top left corner, adjusts true center */ z-index: 30; color: white; }
and here adjusted html:
<div class="span5 well"> <div class="overlay"> <a class="btn btn-primary button" href="/searches/new">sign now!</a> </div> <h3>ez search</h3> <a class="btn btn-primary" href="/searches/new">advanced search</a> <hr/> <p>...</p> </div>
jsfiddle demo
html css css3
Comments
Post a Comment