• Home
  • What’s New
  • Start Here
  • Contact

2 Create a Website Blog

Four CSS3 Tricks to Pimp Your Site in Minutes!

Filed Under: Design 75 Comments

CSS 3If you’re one of those people who shuts down or goes cross-eyed when you read anything about CSS, stay with me.

You guys know how I roll. I will make this as painless and easy for you to implement as possible — at least that’s my goal anyway. The code is provided below so all you need to do is copy and paste.

I’ve been taking some time to learn more about CSS3, which allows you to do more styling on your site with minimal code and images.

Cleaner code and fewer images ultimately means faster loading pages and it’s better for SEO (less code for the engines to wade through.)

I’ve been slowly implementing a few CSS3 tricks here and there so I developed this mini tutorial on how to take advantage of the border, box and shadow properties. Because not all browsers support CSS3, I haven’t gone too crazy with implementation just yet.

The CSS Border/Box Properties

In this post I’m going to focus on adding rounded corners, image borders and shadows.Β  Before CSS3, creating rounded corners and shadows was a royal pain.Β  You had to use an image and position them using coordinates.Β  But with CSS3, it’s a breeze!

1) Creating Rounded Corners

The border-radius attribute creates rounded corners around an element. This code works in IE, Firefox, Chrome, Opera and Safari.

The first thing you need to do is paste the following CSS code into your style.css file. Feel free to adjust the color, width, padding, etc.

div.rounded
{
padding:10px 35px;
background:#eed9a8;
border:2px solid #000000;
border-radius:20px;
-moz-border-radius:20px; /* For Firefox 3.6 and earlier */
width:250px;
}

Now in your post you simply use…

<div class=”rounded”>This text will be surrounded by an object with rounded corners</div>

And this is the result…

This text will be surrounded by an object with rounded corners

2) Creating a Border With an Image

CSS3 allows you to use an image as a border. This does not work in IE — shocking, I know. πŸ˜‰

So let’s say you want to turn the following image into a border…

This is a simple image I created in seconds using Photoshop’s Custom Shape Tool. To turn this into a tiled border, add the following code to your style.css file…

div.border
{
border-width:15px;
width:225px;
padding:15px 20px;
}


#tiled
{
-moz-border-image:url(redBox.gif) 25 25 round; /* Firefox */
-webkit-border-image:url(redBox.gif) 25 25 round; /* Safari and Chrome */
-o-border-image:url(redBox.gif) 25 25 round; /* Opera */
border-image:url(redBox.gif) 25 25 round;
}

Don’t forget to upload your own image and change the name and path of the image named redBox.gif or this won’t work.

Now, in your page, add the following code…

<div class=”border” id=”tiled”>This image is tiled/repeated around the text</div>

And this is the result…

The image is tiled (repeated) around the text

You can also stretch the image border with the following CSS code…

div.border
{
border-width:15px;
width:225px;
padding:15px 20px;
}


#stretched
{
-moz-border-image:url(redBox.gif) 25 25 stretch; /* Firefox */
-webkit-border-image:url(redBox.gif) 25 25 stretch; /* Safari and Chrome */
-o-border-image:url(redBox.gif) 25 25 stretch; /* Opera */
border-image:url(redBox.gif) 25 25 stretch;
}

Now paste the following code into your actual page…

<div class=”border” id=”stretched”>This image has been stretched so it takes on a slightly different shape</div>

And the result is this…

This image has been stretched so it takes on a slightly different shape

3) Creating a Box Shadow Effect

This is a great trick to use if you want to create a shadow box effect around your text, image, etc. You can also use this to add a shadow behind your site’s container. This works in all later versions of IE, Firefox, Safari, Chrome and Opera.

Here’s the CSS code…

div.shadow
{
width:400px;
height:25px;
background-color:#ddd;
-moz-box-shadow: 8px 8px 5px #999; /* Firefox 3.6 and earlier */
-webkit-box-shadow: 8px 8px 5px #999; /* Safari */
box-shadow: 8px 8px 5px #999;
}

Now paste the following into your page…

<div class=”shadow” id=”stretched”>This box will have a shadow behind it</div>

And it will look like this…

This box will have a shadow behind it

You’ve just created an image-free shadow box! Again, feel free to adjust colors, shadow sizes, etc. by editing the CSS code.

4) Creating a Text Shadow

I’m not a huge fan of this CSS3 trick because I think text drop-down shadows can make your site look it’s straight out of 1996.

The key is to make it very subtle by using a shadow color that’s very close to the text color and minimize the shadow spacing.

Text shadows do not work in IE. Again, very shocking. *sarcasm* πŸ˜‰

Paste the following code into your style.css file…

h1.shadow
{
text-shadow: 3px 3px 3px #cc7777;
color: #d22929;
}

To call up the shadow, simply paste…

<h1 class=”shadow”>This text will have a shadow</h1>

And it will give you this…

This text will have a shadow

Notice the shadow is a lighter pink color. Of course, you can change the color of the text and shadow by updating the CSS.

Now you can successfully pimp out your site with CSS3! Don’t you feel current and hip? πŸ™‚

Comments

  1. Richindesign says

    November 7, 2011 at 12:52 pm

    I wish theese styles were more supported and easier to accomplish, nice exmaple lisa

    Reply
  2. BestCalgaryDrivingSchool says

    November 4, 2011 at 3:42 pm

    Great article Lisa! I have been searching for some easy to use CSS code portions and cant thank you enough for these.

    Thanks!

    Reply
  3. Christine says

    October 31, 2011 at 2:00 pm

    Hi, Lisa,
    Maybe you can help me fix my mess. I somehow “lost” my main url for this site and instead have a post with a permalink rather than domainname.com/

    I don’t know how to get the main url back again. It’s a paid for WP Adsense site that auto-populates Adsense ads in strategic places on the pages. The ads were not showing up on the home page, and my “stroke of genius” told me that I was supposed to make my home page a sticky post instead of a page. The ads show up everywhere else but on the home page.

    Any ideas?
    Thanks,
    Christine

    Reply
    • Christine says

      October 31, 2011 at 2:02 pm

      Oh, Lisa, I forgot to mention above that I see the ads on Safari but not on Firefox or Chrome.

      Thanks again,
      Christine

      Reply
  4. Luke says

    October 28, 2011 at 10:37 am

    Thanks Lisa, I have been building websites in old skool HTML for ages using tables and cells and images for rounded borders etc… My graphic / web designer mate only uses CSS to build his sites now and has been on at me for ages to learn it. Your simple examples of how easy and cool it can be has just inspired me to get my act together and learn this now…. nice1

    Reply
  5. Mohsin ali waheed says

    October 27, 2011 at 12:49 pm

    Awesome Css3 tricks specially i like rounded corner trick. I will definitely use it on my blog.

    Reply
  6. Mary Jones says

    October 17, 2011 at 5:46 am

    hey thanks for those simple tricks, i’m gonna use them on my new blog.
    I like the one with the custom border using an image, that looks really neat.

    Reply
  7. Richindesign says

    October 14, 2011 at 5:00 pm

    Box shadow is a nice effect, trying to acchieve the effect in photoshop can be a pain, thanks lisa

    Reply
  8. Jeff-H says

    October 13, 2011 at 5:28 am

    Great post Lisa! just wanted to say thanks for all the great info. Also just wanted to share some free tools to help with generating the code.
    http://www.css3.me/
    http://css3.mikeplate.com/
    http://www.colorzilla.com/gradient-editor/
    http://validator.w3.org/

    Reply
  9. Luke - Web Designer Worthing says

    October 12, 2011 at 3:26 am

    Brilliant, i have been using photoshop to get these effects as it was easy, with this tutorial – which is easy to implement – i can really make my websites faster.. thanks.. Luke

    Reply
  10. wholesale electronics says

    October 11, 2011 at 4:28 am

    I am familiar with the most of tricks lisa wrought here but the second trick β€œCreating a Border With an Image” is very cool.

    Reply
  11. Genie says

    September 27, 2011 at 7:05 pm

    Oh Lisa, you really is such a dear. I have a very great confusion on this that I mostly go tend to my brother for it to get it done. I never had a knack reading such complicated tricks but here you have shared and even made available the interfaces which we will encounter and have given the solution on what to do.
    I am very grateful for this tip. And also thanks to my brother, he is such a lousy tutor πŸ™‚ but I still thank him.
    Happy Day Miss Lisa πŸ™‚
    genie

    Reply
  12. Slappit says

    September 24, 2011 at 9:40 am

    The only ones i would personally use are the rounded borders, text and div background shadow.

    Good blogging though, thanks

    Reply
  13. dlabacs says

    September 20, 2011 at 11:17 pm

    Hi Ms.Lisa, ..I ever wonder how you get on top google search. I really love your videos on youtube , I really love how you present a tutorial and I think I’m in love with you.(^_^) ,

    It’s another great post/tutorial from a techiepreneur Lisa,..

    Reply
  14. Brayden Seekamp says

    September 15, 2011 at 9:37 am

    This is the most helpful post I have ever read, know that cs4 and cs5 is the latest but they still don’t got the kick of cs3.

    Thanks your a big help hit me up when you got another tricks cause some cs tuts cant really help

    Reply
  15. furniture software says

    September 14, 2011 at 10:34 pm

    This is interesting and well explained. Maybe I’ll try some of your CSS β€œtricks” on my blog and see how it will look. πŸ™‚

    Reply
  16. sokun says

    September 13, 2011 at 9:12 pm

    I like this post mainly because i hate css codes. This could prove helpful when i need to add more code.

    Reply
  17. Sahil says

    September 12, 2011 at 12:22 pm

    Great start Lisa. Its good to know that you’re trying to learn CSS3 all on your own. All the best!!!
    Hope you will be a CSS expert one day. πŸ™‚

    Reply
  18. Shelli says

    September 11, 2011 at 8:35 pm

    So, are we suppose to put the codes in the style.css or custom.css? I’m being prompted to use the latter. Will it work either way? I’ve tried both (cutting and pasting the code to my site) and haven’t been successful. I’m sure I’m missing something simple. But what?

    Reply
    • lisa says

      September 11, 2011 at 11:14 pm

      The part highlighted in gray goes in your style.CSS file. The div id= part in italics either goes in your custom functions file or text widget if you are adding to your sidebar for example.

      Reply
    • lisa says

      September 11, 2011 at 11:14 pm

      Also for Thesis the style.CSS is equivalent to custom.css

      Reply
  19. Dekorasyon says

    September 10, 2011 at 4:44 pm

    I love your post, and CSS3 is just epic! You should also check transition effects of CSS3.

    Reply
  20. Gogi says

    September 10, 2011 at 11:34 am

    Thanks Lisa For Sharing this Great CSS3 tutorial.CSS3 really got new cool features .

    Reply
  21. Shelli says

    September 9, 2011 at 8:23 pm

    That looks really interesting. Would definitely add visual interest to my posts. As well as break up the content so readers can easily find the good stuff. Nice to have another trick in my arsenal besides bold and italicized words (LOL)!

    Reply
  22. ravi says

    September 7, 2011 at 12:08 am

    cool tips, i am going to try this!

    Reply
  23. John says

    September 5, 2011 at 12:36 am

    I use the text shadow effect all the time, but i usually use a white shadow on a darker background to give a letterpress type effect

    Reply
  24. Kerala Tour Packages says

    September 4, 2011 at 7:18 am

    Thanks lisa for the tip! I was trying for quite long to get a stylish background for some text in my website. Keep up the good works and continue to post more techie ideas like these πŸ™‚

    Reply
  25. Nathal says

    September 3, 2011 at 1:57 pm

    Excellent list of tips. It’s worth mentioning 2 additional things in order to simplify CSS and improve browser rendering speed:
    1. Avoid using the very common * star attribute for margin and padding resetting (*{padding:0}) and use specific tags instead (h1, h2{padding:0})
    2. Try to classify elements in a way that you don’t use more than 2 selectors in a definition (for example, instead of #sidebar ul li a{color:red}), add an id to that ul and type (#ulId a{color:red})
    Thanks

    Reply
    • lisa says

      September 4, 2011 at 1:17 am

      Great tips, Nathan! Thanks. πŸ˜€

      Reply
  26. Oblikovanje strani says

    September 3, 2011 at 10:21 am

    HTML5 is fantastic for sure. It wont push flash back to oblivion as many said, but it does the job much better than its precursor. Anyway, what i wanted to say in first, i very much appreciate multiple backgrounds option that came with css3. Not that round corners using style sheet are not absolutely great.
    Thanks for sharing this with us.

    Reply
  27. Suresh Khanal says

    September 2, 2011 at 8:10 pm

    That’s awesome Lisa, especially the stretchable image border. Knowing little bit of codding always adds power to your creativity. I’m adding a few codes to my CSS file as well.

    Thank you for the codes with examples.

    Reply
  28. London Pest Control says

    September 2, 2011 at 7:45 am

    I have created my website through google sites and I am finding that some things are limited in terms of what you can do on individual pages such as edit each pages header. I have many images on my site, if you look at it on a mobile also it is all jumbo mumbo. I am not to great on all this and have self taught myself all that I do know, which after much hard work has got me in a decent position for certain keyword phrases on google. But…As far as images go, I just put them onto the site via uploading from my computer, do not really know about the code side of things, guess it may be harming my seo?

    Reply
  29. KevinCrew says

    September 2, 2011 at 2:09 am

    Very Nice Artice. But actually I have come to your blog through google search while search for “commentluv”. I have watched that most of the blogs are using commentluv these days and thats really awesome. Anyway, I have go through your whole article and thats really nice. Thanks for such an interesting article sharing.

    Reply
  30. what is css says

    September 1, 2011 at 10:56 pm

    I didn’t know about using an image as a border. Thanks for sharing. (It seems that css is doing more and more of what had to be done in photoshop with images.)

    Reply
  31. NICO VENGEANCE says

    September 1, 2011 at 9:27 pm

    nice tips… I’m really interest and make me sure for css upgrade in my site…

    Reply
  32. Stephen says

    August 31, 2011 at 10:32 pm

    Hi Lisa,

    Great tips!! I love to add those little borders just to spice up the site a little. I think it goes a long way with really very little effort.

    It is a bummer that IE doesn’t acknowledge the code, but that’s also a very nice subtle reminder that you must check each browser when making changes. I know IE is the easy target (as it should be), but all the browsers have little tweaks about them that just boggles the mind.

    Reply
  33. John Garrett says

    August 31, 2011 at 3:12 pm

    Good ones, Lisa!

    I’m another one of those “It woulda worked so well if not for that blasted Scooby Doo, er, Internet Explorer!” type of people.

    Man this could all be so easy. For me, I really don’t cater to IE at all, but then you get that client who only uses IE and you have to scrap the cool code and use an image or something. Grrrrr…!

    Thanks for the tips!

    Reply
    • lisa says

      August 31, 2011 at 10:31 pm

      I hear ya John. I’ve stopped catering to IE folks too for the most part. Can’t wait until that dang browser is obsolete! πŸ˜€

      Reply
  34. Computer Repair says

    August 31, 2011 at 9:55 am

    CSS is always fun to play around with. But it is kind of sad that IE is just behind with the times and refuse to enable these kind of features…

    Well it is laziness or just don’t want to go that way. Beats me.

    Reply
  35. kunal says

    August 31, 2011 at 9:01 am

    Hey lisa, good job done by you though not from a computer science background. This small small things matter a lot in the blogs and websites. hey can u tell how come you developed interest in this field?;)

    Reply
  36. namco pools says

    August 31, 2011 at 4:55 am

    Cleaner code great help in better ranking for your site

    Reply
  37. William says

    August 30, 2011 at 8:40 pm

    I love CSS3, in theory; the problem is that so many browsers aren’t really ready to take advantage of it. I hate spending time working up some super-cool effects that only people using Opera can actually see!

    Reply
    • lisa says

      August 30, 2011 at 9:48 pm

      Agree, but if you check W3 Schools, most browsers support these tricks (except IE). And the good news is, more and more people are leaving IE for Chrome, Firefox, Safari and Opera. In a year or two we won’t have to worry about browser support as much as we have.

      Reply
  38. askblasters says

    August 30, 2011 at 6:58 pm

    thanks for the tricks gonna try them out right away

    Reply
  39. Paula Mooney says

    August 30, 2011 at 2:33 pm

    Thanks for the simple code tricks.

    I just may use them someday.

    I especially like that rounded corners around text trick. Looks good. I feel a new niche site coming on… πŸ™‚

    Reply
  40. Vince says

    August 30, 2011 at 8:33 am

    I have bookmarked this page to come back. I’ve been wanting to make rounded corners and thought I would need an image for that.
    I like the shadow effect on text too.
    Thanks Lisa for these great tips on CSS 3. Will definitely try them out.

    Reply
  41. Yajaira says

    August 30, 2011 at 2:20 am

    Lisa, I’m a 24/7 webdeveloper, and really interested in new CSS3 scripts. thank you for making this post

    Reply
  42. virendra rajput says

    August 29, 2011 at 9:49 pm

    Hey Lisa please review my blog I have really worked hard on it and would like that you review it for just a sec!
    http://www.teckzone.in
    Thanks

    Reply
  43. virendra rajput says

    August 29, 2011 at 9:48 pm

    Hey Lisa please review my blog I have really worked hard on it and would like that you review it for just a sec!
    Thanks!

    Reply
  44. Shredder says

    August 29, 2011 at 9:34 pm

    I just got my site fixed up with your easy starter templates. I’m not sure if I’m ready to go CSS3 crazy just yet. I’ll keep this in mind though when I want to give something extra emphasis.

    Reply
  45. Sunil from The Extra Money Blog says

    August 29, 2011 at 12:50 pm

    love the simplicity as usual Lisa. I love the rounded corners and will definitely try it out.

    Reply
  46. Samiullah Khan says

    August 29, 2011 at 10:11 am

    It’s good that lisa turned over to teaching css3. Hope we will see much more advanced tricks of css3. I am familiar with the most of tricks lisa wrought here but the second trick “Creating a Border With an Image” is very cool.

    Reply
  47. Flo | Create Your Own Website says

    August 29, 2011 at 9:33 am

    I love the wonderful displays we can achieve with CSS3 and the box shadow is my favorite! It’s unfortunate that our BFF browser IE πŸ˜‰ will not let us show off these designs on our sites.

    Good stuff!

    Reply
    • lisa says

      August 29, 2011 at 4:03 pm

      IE needs to be shot and killed. lol Fortunately fewer people are using it these days.

      Reply
      • Flo | Create Your Own Website says

        August 30, 2011 at 7:21 am

        lol. Just let me know what its happening, I know a Sharp Shooter!

        Reply
        • Jeremy Johnson says

          August 30, 2011 at 11:58 pm

          “IE needs to be shot and killed. lol Fortunately fewer people are using it these days.” Preach it, I second that.

          Reply
          • PTB Support says

            September 11, 2011 at 3:59 am

            Third from me…

            I always design sites for firefox, tweak them for safari, chrome and opera – then rewrite them for IE.

            Until MS either drop IE, or stop making their own standards I think this will always be the case.

            Although globally firefox’s Market share is increasing, over here in the UK 80% of the visitors to my site still use IE.

            :/

  48. Brankica says

    August 29, 2011 at 9:17 am

    Most of the CSS stuff I learned was from your videos and codes you posted on the website. And sometimes, I just study what you do with Firebug (which I know about because of…yes, you guessed it – YOU again).

    I actually use the shadow stuff, I learned about it a few months ago, and now I am using it for some of the H code.

    I love the effect you can achieve with it.

    I love the first part of the code, that is something I can use a lot, the borders, different colors for different purposes, etc.

    Reply
  49. Adeline says

    August 29, 2011 at 8:50 am

    I’ve been following your blog for a quite sometime now, and I must say you’ve made my life starting out to blog less painful. Can’t wait to try these. Many thanks!

    Reply
  50. GNS says

    August 29, 2011 at 7:50 am

    I’ll have to give these a shot. Boy what a techie Lisa. I guess you come from a computer science background?
    Greg

    Reply
    • lisa says

      August 29, 2011 at 11:00 am

      Ha ha! No, not at all. πŸ™‚ Computer science requires you to take math and I’m horrible at it. I’m self taught on the web stuff.

      Reply
Newer Comments »

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search This Blog

Enroll In My Online Courses!

Most Recent Posts

  • I Made $5,000 in 12 Hours With a Small Audience
  • My First $3,000 Month With My Ecommerce Brand
  • Why I Removed My 2Create Courses & More Updates!
  • Passive Income Shifts & What My Marketing DNA Test Results Revealed
  • My Income Evolution Online, Personal Growth & More!
  • Earning With The Amazon Influencer Program and Tutorial
  • Google Warns: Secure Your Site By October or Else…

Get My Blog and Podcast updates

Sign up so you never miss any of my new tips and tricks on my blog and podcast.

About Me

I make a living doing what I love -- teaching online. And I can't wait to help you learn. More about me.

Copyright © 2025 Blog Powered by The Daily Dish Studiopress Theme | Privacy Policy | Affiliate Disclosure