html - Creating a stroked frame effect with css -
i have design effect
i dont care font styles or details, focused right on creating frame , if possible button well. know how kind of effect in css?
here basic html/css code, wont of help. , can modify if suits better. btw using bootstrap 3.
/******** html *********/ <div class="col-md-12 bg-img"> <div>italy has never been close</div> </div> /******** css *********/ .bg-img { display: table; width: 100%; height: 100px; text-align: center; background: #999 url("http://p1.pichost.me/i/15/1380265.jpg") no-repeat fixed center; } .bg-img div { display: table-cell; vertical-align: middle; width:10px; font-weight:700; }
i using generic image, shouldn't make difference. here fiddle. https://jsfiddle.net/3al4xnr8/
you can :after
, :before
pseudo-elements.
div { display: table; margin: 0 auto; width: 30%; padding: 20px; position: relative; height: 200px; } p { display: table-cell; vertical-align: middle; font-size: 40px; } div:before { content: ''; position: absolute; top: 0; left: 0; width: 50%; height: 50%; border-top: 1px solid black; border-left: 1px solid black; } div:after { content: ''; position: absolute; bottom: 0; right: 0; width: 30%; height: 50%; border-bottom: 1px solid black; border-right: 1px solid black; } button { position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 50%); }
<div> <p>lorem ipsum dolor sit amet.</p> <button>button</button> </div>
Comments
Post a Comment