css - How can I insert a small rectangle inside the rectangle? -
.
here link http://jsfiddle.net/ashadee/xhalqvav/.
html code
<a href="#" class="rectangle">eat lunch</a><br>
css
a{ font-size: 1.2em; white-space: normal; } a.rectangle { width: 70%; height: 5%; border: 1px solid black; padding: 5%; margin-top: 0%; background-color: #fafafa; opacity: 0.4; display: block; text-decoration: none; text-align: center; font-family: comic sans ms; box-shadow: 10px 10px 5px #888888; }
how make design 1 in image? should use canvas property.
demo - http://jsfiddle.net/victor_007/xhalqvav/2/
use pseudo
element :after
, :before
styling right box , rounded
a { font-size: 1.2em; white-space: normal; } a.rectangle { width: 70%; height: 5%; border: 2px solid black; padding: 5%; margin-top: 0%; background-color: #fafafa; opacity: 0.4; display: block; text-decoration: none; text-align: center; font-size: 32px; font-family: comic sans ms; box-shadow: 10px 10px 5px #888888; position: relative; } a:before { content: ''; border-right: 2px solid black; height: 100%; position: absolute; background: orange; width: 50px; top: 0; bottom: 0; left: 0; } a:after { content: ''; width: 30px; height: 30px; border-radius: 50%; background: black; position: absolute; left: 35px; top: 50%; transform: translatey(-50%) }
<a href="#" class="rectangle">stanford</a> <br>
Comments
Post a Comment