css - create button with a transparent border that is only on the second part of the button -
want achieve
i have header 0.8 transparency , button border of 0.8 in same color.
the button need aligned center equal bottom of header.
problem
when place 0.8 transparency border on header same color , 0.8 transparency going darker.
possible solution
https://jsfiddle.net/extranion/fnz1ccf0/2/
* { margin:0; padding:0; } body { background-image: url("http://gallery.photo.net/photo/8551440-md.jpg"); } button { background:none; border:none; } header { height:100px; background-color: rgba(41, 52, 61, .8); } .contact { float:right; height:100px; width:200px; position:relative; } .wrap-btn { position:absolute; top:100%; left:50px; height:30px; width:100px; border-radius: 0 0 20px 20px; background-color: rgba(41, 52, 61, .8); } button { position:absolute; bottom:10px; left:10px; width:80px; height:40px; background:orange; border-radius:15px; }
<body> <header> <div class="contact"> lorem ipsum <div class="wrap-btn"> <button>inloggen</button> </div> </div> </header> </body>
question
is there better solution bottom part have border?
not sure if better solution, different approach. working after elements , gradients:
button { top: 100%; position: absolute; width: 90px; margin-top:-28px; height:56px; border-radius:0px 0px 14px 14px; background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 49%,rgba(41, 52, 61, .8) 50%,rgba(41, 52, 61, .8) 100%); } button:after{ content:'login'; position:absolute; left:10px; top:10px; width:70px; height:15px; padding:10px 0px; background:orange; border-radius:10px; }
https://jsfiddle.net/dm8654ga/1/
using gradients way, using after elements - thing don not used content attribute text -> makes difficult translations etc.
ps: if border not rounded, whole thing lot easier (workin boxshadows..)
Comments
Post a Comment