Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You'll need to add content for <code>:before</code> and <code>:after</code> to show. After that, you can position them absolutely and by giving them <code>right: 100%</code> and <code>left: 100%</code> respectively, you can position them in front of and behind the button.</p> <pre><code>button { background:transparent; border: none; padding: 0; margin: 0; line-height: 1; font-size: 12px; cursor: pointer; margin-left: 14px; /* width of :before */ } .back { background: url("http://i.stack.imgur.com/DaQcG.png") 14px 0 repeat-x; color: white; height: 28px; padding: 5px; position: relative; } .back:before { position: absolute; content: ""; height: 28px; top: 0; right: 100%; background: url("http://i.stack.imgur.com/6m2HC.png") 0 0 no-repeat; width: 14px; } .back:after { position: absolute; content: ""; height: 28px; top: 0; left: 100%; background: url("http://i.stack.imgur.com/2WA5B.png") 100% 0 no-repeat; width: 8px; } </code></pre> <p>The definitions of before and after are slightly the same, so you could write it down more compactly, but you need to re-sass it anyway. ;)</p> <p><a href="http://jsfiddle.net/c2B6X/" rel="nofollow">http://jsfiddle.net/c2B6X/</a></p> <p>Tip: Note that downloading three images is less efficient. You can create one image that contains the start and end at the top, and the middle part at the bottom. By positioning the background, you can show the right part inside the elements. This technique is called <a href="http://css-tricks.com/css-sprites/" rel="nofollow"><code>sprites</code></a> and it decreases the number of requests to make.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload