CSS-Tricks*

A Web Design Community curated by Chris Coyier

A little dab'll do ya

Code Snippets

Code Snippets > CSS > “Stitched” Look Submit one!

“Stitched” Look

.stitched {
   padding: 5px 10px;
   margin: 10px;
   background: #ff0030;
   color: #fff;
   font-size: 21px;
   font-weight: bold;
   line-height: 1.3em;
   border: 2px dashed #fff;
   border-top-left-radius: 3px;
   -moz-border-radius-topleft: 3px;
   -webkit-border-top-left-radius: 3px;
   border-bottom-right-radius: 3px;
   -moz-border-radius-bottomright: 3px;
   -webkit-border-bottom-right-radius: 3px;
   border-top-right-radius: 3px;
   -moz-border-radius-topright: 3px;
   -webkit-border-top-right-radius: 3px;
   -moz-box-shadow: 0 0 0 4px #ff0030, 2px 1px 4px 4px rgba(10,10,0,.5);
   -webkit-box-shadow: 0 0 0 4px #ff0030, 2px 1px 4px 4px rgba(10,10,0,.5);
   box-shadow: 0 0 0 4px #ff0030, 2px 1px 6px 4px rgba(10,10,0,.5);
   text-shadow: -1px -1px #aa3030;
   font-weight: normal;
}

Reference URL

Subscribe to The Thread

  1. mrvn says:

    looks pretty awesome!!

  2. This is a great trick!

  3. GNO says:

    The “key” to this look is just the line “border: 2px dashed #fff;” in case anyone wondered what were going on up there…

    • Dor says:

      Well sure, but how did the border get INSIDE the element, or how did the background get out of it?

      I don’t see any background-origin here…

    • GNO says:

      That’s the box-shadow.

  4. Randy says:

    Looks great! I think it looks even better with this added. :-)

    border-bottom-left-radius: 3px 3px;

  5. it is really good one

It's Your Turn

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
--- The Management ---