Quick tutorial: How to use basic CSS3

Posted on by

With CSS3 support now quickly being implemented in all major browsers, including IE9, you can start to take advantage of these features knowing that a reasonable percentage of your audience will indeed be able to see them.

Many of the CSS3 rules and selectors are very simple to implement, and can make tasks that were previously very frustrating in CSS2 incredibly simple. One example is that of the CSS3 ‘border-radius’ rule, which allows you to round the corners on any bordered element. The previous way to do this, with images in each corner, was incredibly annoying and inflexible.

Take a look at Jacob Bijani’s  “border-radius.com” – a free online tool that allows you to experiment with border-radius and will also generate the needed CSS3 code for you to copy and paste in it to your stylesheet.

One important thing you may have noticed – as CSS3 is still a draft currently, many browsers use private namespaces for CSS3 features. The most common ones are –webkit (for WebKit based browsers such as Safari and Chrome), -moz (for Gecko based browsers such as Firefox). Opera uses the straight CSS3 rule without a private namespace attached. As CSS3 moves further along in the standardisation process, expect to see these namespace declarations vanish.

Another great effect you can achieve extremely easily is that of the text-shadow declaration, which is actually a CSS2 rule but hasn’t been widely implemented in browsers until recently.

Take a standard paragraph rule such as:

p { font:font-family: Georgia; font-size: 14px; color: #000;"}

(this sets the font of the paragraph to 14px Georgia in black.)

Example: Here is some text

Simply add the text-shadow decleration to get:

p {font-family: Georgia; font-size: 14px; color: #000;
text-shadow: 2px 2px 2px #0f0; }

Example: Some text with a shadow!

As you can see above if you are using a compatible browser, this will give you a text shadow that is 2px to the left of the original paragraph, 2px below and a ‘blur’ with a 2px radius. The #f00 gives the shadow its colour (green). This is a great effect to use to add a bit of depth to your headers. Be careful on overusing this effect though, as it’s best used sparingly.

Finally, for our last example, we’ll show you how to do basic animations in CSS3. This is perhaps the least supported part of the CSS3 specification, with only WebKit and Opera supporting them at present. Firefox4 and IE9 should, all being well, be implementing them before the final release.

Let’s start with a div, with an ID of ‘animateme’, setting it’s background colour to red (#f00) and the foreground colour to white (#fff). We also set up the transition effect:

<!--
			#animateme {
			background-color: #F00;
			color: #FFF;
			-webkit-transition: all 1s ease-in-out;
			}
 
-->
<div id="”animateme”">
			Animate me!</div>

As you can see, it produces a red box with some text in it. To add an animation when we hover, you simply need to add the following rules:

#animateme:hover {
	background-color: #00f;
	-webkit-transform: rotate(360deg) scale(2);
}

Example:

Animate me!

The above rule, if you’re using a compatible browser, will slowly animate the red background to blue, over a period of 1s. Furthermore, the rotate and scale commands give it a somewhat ridiculous spin-and-grow effect.

As you can see, using advanced effects in CSS3 is not complicated – in many ways it makes things that used to be hard and frustrating quite simple. Once IE9 is released and has a significant amount of users, we should see these effects taking hold across the web.

If you’d like us at xDesign365, Edinburgh’s premiere new media agency, please get in touch at sales@xdesign365.com or give us a call on UK 0131 339 3838. We’ll be happy to help with any sort of web design or development process you need implemented.

34 Responses to “Quick tutorial: How to use basic CSS3”

  1. Funny, I had been discussing this point with my older sister the other day, now I’ll have a single a lot more argument in my hand when it’ll come to confrontation when once more….

  2. Hello there, I must say it is a clever posting. I’ll definitely be seeking in on this web site once again soon….

  3. Yes! I agree what you say!…

  4. Hi! Your submit rocks and is really a excellent understand!…

  5. Yes, thank for your info a million! Ought to discover anybody organizing Tea Party. I would like to participate in organizing….

  6. i truly like your web web site. Its quite informative. Goodbye!…

  7. griddle says:

    Thank you with the well-thought article. I’m in fact at operate proper now! So I must go off without having reading all I’d like. But, I set your blog on my RSS feed in order that I can read a lot more….

  8. Thank you……

    this is really cool, I like here!…

  9. Thank you……

    It is a highly rated websites.I have bookmarked the web page and also I will tell my buddies regarding it.Cheers…

  10. Excellent post! I’ll subscribe perfect now wth my feedreader software!…

  11. I wants to thank you for your endeavors you could have created in publishing this write-up. I am trusting the same greatest operate from you in the future too. Actually your fanciful writing abilities has inspired me to start my personal blog now. Genu…

  12. i absolutely like your world wide web internet site. Its quite informative. Goodbye!…

  13. Life goes on…

    In three words I can explain everything I have learned about life: It goes on….

  14. valuable post…

    You got a really great blog I have been here reading for about half an hour. I am a newbie and your post is valuable for me….

  15. That is a very good blog site post and I defer for you what you could have said right here. I have previously subscribed for your RSS feed in Firefox and will probably be your typical reader. Many thanks for your time in writing the publish….

  16. Your point is valueble for me. Thanks!…

  17. Hi, thank you so very much for these tips!…

  18. This is my problem…

    Amazingly webpage, I like how your website looks! The layout is great!…

  19. You’ve got your place via much better than I at any time could, thank you!…

  20. Just wanted to say……

    happy new years!…

  21. I thought that was extremeley fascinating. Thank you with the unusual data. I’ll keep subsequent this….

  22. Good brief and this post helped me alot. Say thank you I looking for your facts….

  23. This blog site is great. How did you come up witht he idea?…

  24. I thought that was extremeley fascinating. Many thanks for that unusual info. I’ll retain next this….

  25. Use “onecentcoupons” Hostgator coupon code to get $9.94 OFF the webhosting price. Retributory preserve the promo cypher spell inflict.

  26. Georgia is my most loved vacationing spot! It might not be the most classy place to visit, but I still choose it over everywhere else.

  27. Janis says:

    Great blog it’s not often that I comment but I felt you deserve it.

  28. Hi. I needed to drop a quick note to impart my thanks. I have been following blog for any month approximately and have plucked up a heap of good information in addition to relished the way in which you’ve structured your website. I’m trying to run my own blog however I believe its too general and that i want to focus more on smaller topics.

  29. I’m just going to tell you up front that I have an idea for how you can get some more cost-effective web hosting. You can save a bunch of money by using multi-site webhosting and I have found the best offer available. Fast Next is the hosting company that I am talking about. I use them for all my websites. All plans are specially created for multi-domain hosting. The main hosting account comes with a multi-manager that allows you to completely control the functions of all of your websites from one control panel (but each domain gets its own control panel as well). With MultiManager, each domain has its own directory structure, mail accounts, ftp accounts, and separate domain control panel (cPanel). All servers are fully owned by the company and have been specially tailored for this type of hosting environment. The secure data center for these servers is US based and located just outside New York City. They have 55,000 square feet of data center floor space so they are prepared to grow as fast as the supply and demand chain expands. You can search all you want but you won’t find a better deal than this for true multi-domain hosting! For just $6.95 per month, you can have everything that you need, all in one place. Check It Out -> http://adf.ly/1WI5R

  30. Nice post, I’ll be I check back frequently keep it up.

  31. sehr schlechter artikel sie verfälschen die wahrheit

  32. I don’t commonly comment but I gotta admit regards for the post on this great one : D.

Leave a Reply

Recent Posts

Merry Christmas and a Happy New Year from xDesign365!

With the holiday period quickly approaching we would like to wish all of our past and present customers a Merry Christmas and a Happy New Year. 2011 has been a prosperous year for xDesign365, having increased our team from 4 to 7, relocated to larger premises, investment in new equipment and gaining many long term Read More …

We’re hiring! Experienced UI/UX designer/developer

We are a busy Edinburgh based creative agency looking to add to its growing team. We have recently relocated to our own offices in the West End of Edinburgh to accommodate our growth. We are a young team of passionate developers and graphic artists. We specialise in mobile applications with custom web based backend management Read More …

Related Posts

Our Android application is helping keep the roads clear of snow!

Today, STV News Edinburgh posted an article regarding a one-of-a-kind Application currently in development here at xDesign365.

xDesign365 in BusinessComment magazine

We got a favourable writeup from BusinessComment magazine, take a look below: Edinburgh-based developers set to revolutionise Glasgow bar scene   Innovative Edinburgh-based web development company xDesign365 has launched a mobile application that could change the way Glaswegians plan their night out. The WhereToNow app will feature information on Glasgow’s bars and restaurants, allowing users Read More …

Looking for an Edinburgh based web design company with international reach? Want your website to develop a new customer base for your company? Then you've come to the right place...

xDesign365 is an innovative company with experience in developing websites, ecommerce tools, custom software and all major Smartphone platforms.

Naming Sainsbury's, Redco Milne and AFA Press amongst our clients, the directors of xDesign365 boast 14 years' combined experience in the web development business.

We like to think it's our skill that gets us noticed by the big names. Specialising in bespoke design and development, xDesign365 offers complete custom solutions to your business dreams.

Based in Edinburgh and working with clients across the world, xDesign365 has built a reputation for delivering innovative tools that will transform the way you do business.

We've developed everything from ecommerce sites, to iPhone apps with inbuilt geolocation technology. And we pride ourselves on adding value. From briefing through development, we hope you'll be pleasantly surprised at the amount of innovative ideas we bring to the table.

Web designers with creative flair. What's not to like?

Team Profile

Having first worked together over six years ago, Martin Alderson and Euan Andrews formed xDesign365 in January 2010. Over the year, we have made it our mission to find the best talent in the country...

  • Euan Andrews Managing Director

    Favourite Drink: Robinsons Apple and Blackcurrant Juice Favourite film: Saving Private Ryan Favourite place in the world: Grand Canyon

  • Martin Alderson Technical Director

    Favourite film: Berlin Calling Most likely to be... Listening to techno Area of expertise: Being a walking wikipedia

  • Shane Rounce Lead Web Designer and Frontend Developer

    Favourite Drink: Sailor Jerry's and Dr. Pepper Favourite website: http://www.flickr.com Most likely to say: Awwwwwh man.

  • Nick Babenko Lead App and Backend Developer

    Favourite DJ: Boy 8-Bit Favourite film: The social network Most likely to be: programming

  • Thomas Clulow iOS and Android Developer

    Favourite TV Show: Firefly Favourite Drink: Real Ale Most likely to be... pretending to be good at Halo.

  • Ross Oliver iOS Developer

    Favourite film: The Usual Suspects Most likely to be: Golfing Area of expertise: C, Java, Objective-C

What We Do

Specialising in fresh and unique design, the xDesign365 team creates stunning websites that are dynamic and efficient.

But it's not enough to just be a great web designer anymore. That's where the backend comes in. We don't want to blind you with science, but here's what we can do...

Location

The xDesign365 team occupies rather nice offices in Edinburgh. Come over for a coffee and a chat sometime.

Address:
xSolutions365 Ltd, 3 Coates Place, Edinburgh, EH3 7AA, United Kingdom

Map:

Give us a Call on: 0131 339 3838

Contact Us

Be sure to include your full name.Your Full Name:*

Please use an email we can contact you at.Your Email:*

Please use a number we can give you a call on.Your Number:*

Let us know what it is you need doing.Message: