Have Fun w/ Borders – Beveled, Pressed, & More!
Since I released my new redesigned blog, a lot of people have asked me how I styled the pressed effect on my category navigation. I would like to share some simple border style tricks to get various effects for your next project.
Light Shadow

A simple light shadow effect can be achieved with using shades of grey with borders. With CSS3 you can achieve a real shadow effect using box shadow, but this is a clean and simple way that works in all browsers.
CSS
.shadow {
padding: 20px;
border: 1px solid #f0f0f0;
border-bottom: 2px solid #ccc;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
Pressed

The pressed effect is very similar to the CSS Letter Press technique but we rely solely on border colors to achieve the effect. Add some CSS3 rounded corners and you can achieve a very clean pressed look to your layouts.
CSS
.pressed {
color: #fff;
padding: 20px;
background: #111;
border: 1px solid #000;
border-right: 1px solid #353535;
border-bottom: 1px solid #353535;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
Beveled

This technique is very similar to your double border technique commonly used with images. With a little bit of tinkering, you can achieve a subtle beveled effect using the outline property.
CSS
img.light {
outline: 1px solid #ddd;
border-top: 1px solid #fff;
padding: 10px;
background: #f0f0f0;
}
img.dark {
outline: 1px solid #111;
border-top: 1px solid #555;
padding: 10px;
background: #333;
}
Indented Lines

I use this technique often when creating vertical menus and lists. Its a simple combination of top and bottom borders with different shades of the background color. Keep in mind the first-child and last-child CSS selectors are not supported by older browsers. You can read more about this here. To get around it, you can use some jQuery to support older browsers.
CSS
#indented ul{
margin: 20px 0; padding: 0;
list-style: none;
}
#indented ul li {
border-top: 1px solid #333;
border-bottom: 1px solid #111;
}
#indented ul li:first-child {border-top: none;}
#indented ul li:last-child {border-bottom: none;}
#indented ul li a {
padding: 10px;
display: block;
color: #fff;
text-decoration: none;
}
#indented ul li a:hover {background: #111;}
Related Articles
- Quick Tip: Multiple Borders with Simple CSS
- Multiple Backgrounds and Borders with CSS 2.1
- CSS Trick: Creating a Body-Border
- Creating Shapes With CSS Borders
- CSS SPEECH BUBBLE
Related Posts
Author Bio
My name is Soh Tanaka and I am a Los Angeles based designer/front-end developer specializing in CSS driven web design with an emphasis on usability and search engine optimization. I also run a CSS Gallery which is updated daily with the best CSS websites from around the world. Come check it out!
You can learn more about me or
Follow me on twitter for more updates and resources!
Did You Enjoy This Post?
Subscribe via RSS or by email to get all upcoming tutorials and articles delivered straight to you.




+ Add Comment53 Peeps Have Spoken Their Minds...
Awesome! Thanks Soh…. great tricks
I love the indented lines. I definitely want to utilize that style in an upcoming project. They look great on your sidebar here. It is a very subtle, but powerful effect.
Wha.. Not bad.
Nice tricks ;)
Very simple yet nice tips :D
wow!.. everything in css..
Thanks for the useful tutorials! Borders and shadows add dimension and depth to an increasingly flat web. A couple years ago the USPS sent out a promo card around Christmas. Every object on the card had some kind of shadow or border and it really made the piece come alive, which isn’t easy to do on paper. I was so impressed I saved it. If I can find it now, I’ll scan and send you a copy, or maybe post somewhere on my site. But again, thanks for the CSS tricks. I’ll be sure to use them in the future :-)
Great tips. I’ve noticed small touches like this add depth to layouts that would otherwise be pretty vanilla. Thanks!
Very useful tricks. Thanks Soh!
Wicked post I was just about to figure this out of a site I’m working on. It’s like you read my mind, thanks.
Really nice technique! I have been using box-shadow with inset lately to achieve similar results, but yours is cross browser!
Tanaka-san,
thought you will talk about the black blackground effect. Great tuto though…arigatou gozaimasu.
Thanks so much. This is awesome!
Nice post. no need image again.. :-)
i’m enjoy this post :D ;)
But if you have white or black bg color, you cant do these!!:P
Why not? You can just use diff shades of the background color ;-)
Very helpful, thanks!
thanks for this in-depth look on shadows, very helpful as usual.
Simple and great! Thank you.
Sweet dude! I am in a redesign and was going to use images for this effect… Now I don’t have too! Yay :-)
Some really great tips, and a really nice site too man. :)
I just recently discovered your blog, all quality posts.
Keep up the good work!
Great tips, these small details are very important for a good looking site. Thank you !
WOW. I always thought these were image based. Really good stuff!
Ampuuuuhhhhhhhhhhh!!!great tutorial!
I would like to ask about how do we add border(pressed & bevel)around image….irregular image especially…….thnks….
Always great tips
nice one soh! thanks.
Thanks very much, this is great! Especially the indented lines, how often designers using images for that…
Great use of CSS. A lot better than slicing, dicing, and well you get the point :)
Thanks!
great trick soh..simplicity..but sorry,can you make a tutor about your top nav that like sliding effect?I like that..
hey, thats cool!
twothumbs, like this!
love the tuts
good tips… working ie….
I love all your tutorials.
Is there a way to get this to work with IE6/7 as well? I’m amazed with how well your site works with older IEs. Mine looks like absolute crap as soon as you leave Firefox/Safari/Opera.
Hey Soh,
Cool trick.. I have a question about your AVATAR trick when you see this plz answer me..!! you use a png image above the avatar, so now I can’t save that image by using right click option(Save Image As). So is it possible by using a png image just like you did to prevent copying images from users/visitors..actually this is the technique adopted by most of the stock-photography sites such as Corbis.com
Regards.
Ajith Paul
nice work!
‘Been wanting to learn this for a long time, thanks a bunch!
Have Fun w/ Borders?
That’s racist!
Why! Lots of people still use IE6 or IE7….?
Evolution of HTML5 and CSS3 will not be visible until death of those Browser…
This trick or method is futuristic…
Another great tutorial, thanks !!!
Nice tips will definitely use these in the future thanks!
Wow,. nice tips.
Great job !
Top work – the indented line technique is cleverly simple.
Awesome!
I have used the styles that you have mentioned here but not the way you have done.
I will also try this technique.
Thanks! Soh for posting such nice articles.
Love your site. Very good tips
Awesome tricks, as always :)
Awsome article, thank you!!!
Great article mate, this is a great trick for using those styles.
awesome n very simple trick !! gr8 buddy !
every time i read ur post.. i just fall crazy 4 ur work.. !!
Wow thanks for these tips!
Excellent Tips, Please Keep it up, Thanks.
Speak Your Mind...