Home arrow Style Sheets arrow Page 3 - Displaying Rounded Corners Built with CSS3 in a Wider Range of Browsers
STYLE SHEETS

Displaying Rounded Corners Built with CSS3 in a Wider Range of Browsers


Welcome to the last part of a five-part series that explains how to build rounded corners with CSS3. In this part you'll learn how to use two properties discussed in previous articles in the series together. In this way, a wider variety of browsers will render your rounded corners correctly.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
March 22, 2010
TABLE OF CONTENTS:
  1. · Displaying Rounded Corners Built with CSS3 in a Wider Range of Browsers
  2. · Review: rendering rounded corners in WebKit-based browsers
  3. · Rendering rounded corners in a wider range of browsers
  4. · Including the previous CSS code into a web page

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Displaying Rounded Corners Built with CSS3 in a Wider Range of Browsers - Rendering rounded corners in a wider range of browsers
(Page 3 of 4 )

As I explained in the section that you just read, there’s a simple way to render rounded corners in a larger number of browsers. Assigning at the same time the two custom “border-radius” properties to the same HTML element will to the trick, even though this is nothing but a quick and dirty approach which is very distant from following the CSS3 standard.

Anyway, achieving this is so easy that it’s worthwhile to make the effort. So, here are the CSS styles that introduce the enhancement mentioned before:    

<style type="text/css">

body {

    padding: 0;

    margin: 0;

    background: #fff;

    font: 1em Arial, Helvetica, sans-serif;

    color: #000;

}

#wrapper {

    width: 960px;

    margin: 0 auto;

}

#header, #content, #footer {

    padding: 30px;

}

.rounded_container {

    width: 400px;

    padding: 20px;

    background-color: #39f;

    -webkit-border-radius: 2em;

    -moz-border-radius: 2em;

}

</style>

Done. With this subtle modification, any HTML element that has the above “rounded_container” CSS class assigned to it will be rendered with rounded corners on WebKit and Mozilla-based browsers. Considering that achieving this required to write only one additional CSS declaration, the result is definitely more than acceptable.

Naturally, to see the impact introduced by this small change more clearly, we need to include the previous CSS styles in a web page. That’s exactly what I plan to do in the next segment. So click on the link below and read the next few lines.


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials